httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r314952 - /httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c
Date Wed, 12 Oct 2005 15:57:58 GMT
Author: pquerna
Date: Wed Oct 12 08:57:56 2005
New Revision: 314952

URL: http://svn.apache.org/viewcvs?rev=314952&view=rev
Log:
- Prevent one crash, when the strstr fails.  This means it is possibly a badly formed MIME
email, but this fix exposes another crash when we try to download these broken MIME segments.

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=314952&r1=314951&r2=314952&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 Wed Oct 12 08:57:56 2005
@@ -158,7 +158,10 @@
         mail->body = body;
     }
     else {
-        mail->body = strstr(body, "\n\n") + 2;
+        mail->body = strstr(body, "\n\n");
+        if (mail->body != NULL) {
+            mail->body += 2;
+        }
     }
 
     /* If the mail is a multipart message, search for the boundary,
@@ -261,7 +264,12 @@
        it's a MIME part, its correct length will be set after the call
        to mbox_mime_decode_multipart just a dozen lines above. */
     else {
-        mail->body_len = strlen(mail->body);
+        if (mail->body != NULL) {
+            mail->body_len = strlen(mail->body);
+        }
+        else {
+            mail->body_len = 0;
+        }
     }
 
     return mail;



Mime
View raw message