httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1325872 - /httpd/mod_mbox/branches/convert-charsets/module-2.0/mod_mbox_cte.c
Date Fri, 13 Apr 2012 17:55:38 GMT
Author: sf
Date: Fri Apr 13 17:55:37 2012
New Revision: 1325872

URL: http://svn.apache.org/viewvc?rev=1325872&view=rev
Log:
fix bug extracting charset from RFC2047 encoding

Modified:
    httpd/mod_mbox/branches/convert-charsets/module-2.0/mod_mbox_cte.c

Modified: httpd/mod_mbox/branches/convert-charsets/module-2.0/mod_mbox_cte.c
URL: http://svn.apache.org/viewvc/httpd/mod_mbox/branches/convert-charsets/module-2.0/mod_mbox_cte.c?rev=1325872&r1=1325871&r2=1325872&view=diff
==============================================================================
--- httpd/mod_mbox/branches/convert-charsets/module-2.0/mod_mbox_cte.c (original)
+++ httpd/mod_mbox/branches/convert-charsets/module-2.0/mod_mbox_cte.c Fri Apr 13 17:55:37
2012
@@ -308,9 +308,10 @@ static char *mbox_cte_decode_rfc2047(apr
 
     if (strncmp(src, "=?", 2) != 0)
         return src;
+    charset = src + strlen("=?");
 
     /* Encoding mode (first '?' after charset) */
-    mode = strstr(src + 2, "?");
+    mode = strstr(charset, "?");
     if (!mode || mode == src) {
         return src;
     }
@@ -356,7 +357,7 @@ static char *mbox_cte_decode_rfc2047(apr
     }
 
     /* Convert charset to uppercase */
-    charset = apr_pstrmemdup(p, src, mode - src - 1);
+    charset = apr_pstrmemdup(p, charset, mode - charset - 1);
     for (i = 0; i < strlen(charset); i++) {
         charset[i] = toupper(charset[i]);
     }



Mime
View raw message