httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From max...@apache.org
Subject svn commit: r366720 - /httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c
Date Sat, 07 Jan 2006 13:41:21 GMT
Author: maxime
Date: Sat Jan  7 05:41:18 2006
New Revision: 366720

URL: http://svn.apache.org/viewcvs?rev=366720&view=rev
Log:
Fix a mail header parsing bug.

 * module-2.0/mod_mbox_mime.c:
    (mbox_mime_decode_multipart): restore the correct character at end
     of chomped header lines during processing. Avoids eating a
     newline character that is later missing when searching for
     header-body separation.


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/viewcvs/httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c?rev=366720&r1=366719&r2=366720&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 Sat Jan  7 05:41:18 2006
@@ -79,11 +79,13 @@
 	/* If available, get MIME part name */
 	tmp = ap_strstr(body, "name=");
 	if (tmp && tmp < headers_bound) {
+            char c;
 	    tmp += sizeof("name=") - 1;
 	    k = tmp;
 
 	    while (*k) {
 	        if (isspace(*k) || *k == ';') {
+                    c = *k;
 		    *k = 0;
 		    break;
 		}
@@ -98,7 +100,7 @@
 	        mail->content_name = apr_pstrdup(p, tmp);
 	    }
 
-	    *k = ';';
+	    *k = c;
 	}
     }
     else {
@@ -110,11 +112,13 @@
     /* Check Content-Disposition if the match is within the headers */
     tmp = ap_strstr(body, "Content-Disposition: ");
     if (tmp && tmp < headers_bound) {
+        char c;
 	tmp += sizeof("Content-Disposition: ") - 1;
 	k = tmp;
 
 	while (*k) {
 	    if (isspace(*k) || *k == ';') {
+                c = *k;
 		*k = 0;
 		break;
 	    }
@@ -123,7 +127,7 @@
 
 	/* Copy the Content-Disposition and reset *k */
 	mail->content_disposition = apr_pstrdup(p, tmp);
-	*k = '\n';
+	*k = c;
     }
     else {
         mail->content_disposition = apr_pstrdup(p, "inline");
@@ -134,11 +138,13 @@
       {
 	  tmp = ap_strstr(body, "Content-Transfer-Encoding: ");
 	  if (tmp && tmp < headers_bound) {
+              char c;
 	      tmp += sizeof("Content-Transfer-Encoding: ") - 1;
 	      k = tmp;
 
 	      while (*k) {
 		  if (isspace(*k) || *k == ';') {
+                      c = *k;
 		      *k = 0;
 		      break;
 		  }
@@ -147,7 +153,7 @@
 
 	      /* Copy the Content-Disposition and reset *k */
 	      mail->cte = mbox_parse_cte_header(tmp);
-	      *k = '\n';
+	      *k = c;
 	  }
       }
     else {



Mime
View raw message