On 09/09/2008 10:10 PM, Ruediger Pluem wrote:


On 09/03/2008 01:01 AM, [EMAIL PROTECTED] wrote:
Added: httpd/httpd/trunk/modules/filters/sed1.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/sed1.c?rev=691418&view=auto ==============================================================================
--- httpd/httpd/trunk/modules/filters/sed1.c (added)
+++ httpd/httpd/trunk/modules/filters/sed1.c Tue Sep  2 16:01:47 2008
@@ -0,0 +1,957 @@
+/*
+ * Copyright (c) 2005, 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Use is subject to license terms.
+ *
+ *    Copyright (c) 1984 AT&T
+ * All Rights Reserved + *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. + * See the License for the specific language governing permissions and
+ * limitations under the License. + */
+
+#include "apr.h"
+#include "apr_lib.h"
+#include "libsed.h"
+#include "sed.h"
+#include "apr_strings.h"
+#include "regexp.h"
+
+char    *trans[040]  = {
+    "\\01",
+    "\\02",
+    "\\03",
+    "\\04",
+    "\\05",
+    "\\06",
+    "\\07",
+    "-<",
+    "->",

What are the above constants supposed to be. Opening the file in vi shows that they are special characters or better control characters. Looking with a hex editor these () seem to be \\08.
Is this correct?
BTW: I noticed it because this commit message broke the atom feed of mod_box for the cvs list as these characters make the xml document of the feed invalid. But I guess this is an error in mod_mbox.

IMHO the following patch should fix the mod_mbox error by correctly
encoding these chars:

Index: module-2.0/mod_mbox_cte.c
===================================================================
--- module-2.0/mod_mbox_cte.c   (Revision 693585)
+++ module-2.0/mod_mbox_cte.c   (Arbeitskopie)
@@ -91,6 +91,9 @@
         else if (s[i] == '&') {
             j += 4;
         }
+        else if (((unsigned char) s[i]) < 32) {
+            j += 5;
+        }
     }

     /* If there is nothing to escape, just copy the body to the new
@@ -118,6 +121,10 @@
                 memcpy(&x[j], "&amp;", 5);
                 j += 4;
             }
+            else if (((unsigned char) s[i]) < 32) {
+                apr_snprintf(&x[j], 6, "&#%02i;", s[i]);
+                j += 4;
+            }
             else {
                 x[j] = s[i];
             }


As I have no environment where I can test mod_mbox can someone please check 
this patch?

Regards

Rüdiger


Reply via email to