httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1414449 - /httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c
Date Tue, 27 Nov 2012 22:40:19 GMT
Author: rjung
Date: Tue Nov 27 22:40:19 2012
New Revision: 1414449

URL: http://svn.apache.org/viewvc?rev=1414449&view=rev
Log:
Fix header and parameter parsing when decoding MIME multipart:
- When skipping to th enext header skip after the newline, not
  to the newline.
- Skip initial empty parameter (leading ";")

Both problems detected by a valid Airavata announcement mail
contained in www-anounce/201211 with windows-1252 encoding,
but mod_mbox used empty encoding. Result was broken UTF-8 XML.

Modified:
    httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c

Modified: httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c
URL: http://svn.apache.org/viewvc/httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c?rev=1414449&r1=1414448&r2=1414449&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c (original)
+++ httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c Tue Nov 27 22:40:19 2012
@@ -41,7 +41,7 @@ static char *mbox_mime_get_header(apr_po
     int namelen = strlen(name);
     for (ptr = *string;
          ptr && *ptr && ptr < end ;
-         ptr = ap_strchr(ptr + 1, '\n'))
+         ptr = ap_strchr(ptr + 1, '\n') + 1)
     {
         int l;
         if (strncasecmp(ptr, name, namelen) != 0)
@@ -81,7 +81,7 @@ static char *mbox_mime_get_parameter(apr
     while (ptr && *ptr && ptr < end) {
         int have_match = 0;
         const char *val_end;
-        while (*ptr && apr_isspace(*ptr))
+        while (*ptr && (apr_isspace(*ptr) || *ptr == ';'))
             ptr++;
         if (strncasecmp(ptr, name, namelen) == 0) {
             ptr += strlen(name);



Mime
View raw message