]> Pileus Git - ~andy/fetchmail/commitdiff
mimedecode: Fix multipart/mixed detection.
authorMatthias Andree <matthias.andree@gmx.de>
Thu, 16 Jun 2011 19:44:42 +0000 (21:44 +0200)
committerMatthias Andree <matthias.andree@gmx.de>
Thu, 16 Jun 2011 20:04:05 +0000 (22:04 +0200)
Fixes a regression introduced in release 5.0.0 in March 1999 that was
attributed to Henrik Storner.

NEWS
unmime.c

diff --git a/NEWS b/NEWS
index 3df56f6dd24e146e13435250a93bbb441d67be27..2394703844e2c340e49e9c8394910c7333acad32 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -91,6 +91,12 @@ NOTE THIS IS AN ALPHA RELEASE THAT HAS NOT BEEN THOROUGHLY TESTED!
   will actively forbid SSLv2 negotiation by means of SSL_OP_NO_SSLv2.
   To fix Debian Bug#622054.
 
+# REGRESSION FIXES
+* The mimedecode feature now properly detects multipart/mixed-type matches, so
+  that quoted-printable-encoded multipart messages can get decoded.
+  (Regression in 5.0.0 on 1999-03-27, as a side effect of a PGP-mimedecode fix
+  attributed to Henrik Storner.)
+
 # CHANGES
 * A foreground fetchmail can now accept a few more options while another copy is
   running in the background.
index 68944849c30fca43691d549c4726e76e6082428c..070d7945aee16f0c4cad27e53e3cd66fb6dfb02f 100644 (file)
--- a/unmime.c
+++ b/unmime.c
@@ -459,7 +459,7 @@ int MimeBodyType(char *hdrs, int WantDecode)
 
        /* Check Content-Type to see if this is a multipart message */
        if ( (CntType != NULL) &&
-               ((strncasecmp(CntType, "multipart/mixed", 16) == 0) ||
+               ((strncasecmp(CntType, "multipart/mixed", 15) == 0) ||
                 (strncasecmp(CntType, "message/", 8) == 0)) ) {
 
            char *p1 = GetBoundary(CntType);
@@ -469,7 +469,6 @@ int MimeBodyType(char *hdrs, int WantDecode)
                   the boundary string */
                strcpy(MultipartDelimiter, "--");
                strlcat(MultipartDelimiter, p1, sizeof(MultipartDelimiter));
-               MultipartDelimiter[sizeof(MultipartDelimiter)-1] = '\0';
                BodyType = (MSG_IS_8BIT | MSG_NEEDS_DECODE);
            }
        }