[packages/exim] - rel 5; mime segfault fix
arekm
arekm at pld-linux.org
Sat Nov 28 11:56:48 CET 2015
commit b8bf635f1debb1e55e732603b79b2a843c650294
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Nov 28 11:56:42 2015 +0100
- rel 5; mime segfault fix
exim-git.patch | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exim.spec | 2 +-
2 files changed, 130 insertions(+), 1 deletion(-)
---
diff --git a/exim.spec b/exim.spec
index 835034b..09cc6b9 100644
--- a/exim.spec
+++ b/exim.spec
@@ -21,7 +21,7 @@ Summary(pl.UTF-8): Agent Transferu Poczty Uniwersytetu w Cambridge
Summary(pt_BR.UTF-8): Servidor de correio eletrônico exim
Name: exim
Version: 4.86
-Release: 4
+Release: 5
Epoch: 2
License: GPL
Group: Networking/Daemons/SMTP
diff --git a/exim-git.patch b/exim-git.patch
index ca84f1a..0699820 100644
--- a/exim-git.patch
+++ b/exim-git.patch
@@ -1233,3 +1233,132 @@ index a82fc2d..1395be4 100644
if( ++n == 4 )
{
+
+commit a23a9d099ac9d112a6d961e00539bcf1bbb1ef7e
+Author: Jeremy Harris <jgh146exb at wizmail.org>
+Date: Wed Nov 25 17:49:03 2015 +0000
+
+ MIME: fix crash on filenames having null charset. Bug 1730
+
+ (cherry picked from commit 622dbd6a512d2c7786125e3b80e96a43e54b8e90)
+
+diff --git a/src/src/mime.c b/src/src/mime.c
+index 618364a..cc9ffb7 100644
+--- a/src/src/mime.c
++++ b/src/src/mime.c
+@@ -550,7 +550,8 @@ int size = 0, ptr = 0;
+ uschar * val = string_cat(NULL, &size, &ptr, US"=?", 2);
+ uschar c;
+
+-val = string_cat(val, &size, &ptr, charset, Ustrlen(charset));
++if (charset)
++ val = string_cat(val, &size, &ptr, charset, Ustrlen(charset));
+ val = string_cat(val, &size, &ptr, US"?Q?", 3);
+
+ while ((c = *fname))
+@@ -607,7 +608,7 @@ while(1)
+ if (!fgets(CS header, MIME_MAX_HEADER_SIZE, f))
+ {
+ /* Hit EOF or read error. Ugh. */
+- DEBUG(D_acl) debug_printf("Hit EOF ...\n");
++ DEBUG(D_acl) debug_printf("MIME: Hit EOF ...\n");
+ return rc;
+ }
+
+@@ -619,12 +620,12 @@ while(1)
+ if (Ustrncmp((header+2+Ustrlen(context->boundary)), "--", 2) == 0)
+ {
+ /* END boundary found */
+- DEBUG(D_acl) debug_printf("End boundary found %s\n",
++ DEBUG(D_acl) debug_printf("MIME: End boundary found %s\n",
+ context->boundary);
+ return rc;
+ }
+
+- DEBUG(D_acl) debug_printf("Next part with boundary %s\n",
++ DEBUG(D_acl) debug_printf("MIME: Next part with boundary %s\n",
+ context->boundary);
+ break;
+ }
+@@ -648,7 +649,7 @@ while(1)
+
+ for (q = p; *q != ';' && *q; q++) ;
+ *mh->value = string_copynlc(p, q-p);
+- DEBUG(D_acl) debug_printf("found %s MIME header, value is '%s'\n",
++ DEBUG(D_acl) debug_printf("MIME: found %s header, value is '%s'\n",
+ mh->name, *mh->value);
+
+ if (*(p = q)) p++; /* jump past the ; */
+@@ -666,7 +667,7 @@ while(1)
+ {
+ mime_parameter * mp;
+
+- DEBUG(D_acl) debug_printf(" considering paramlist '%s'\n", p);
++ DEBUG(D_acl) debug_printf("MIME: considering paramlist '%s'\n", p);
+
+ if ( !mime_filename
+ && strncmpic(CUS"content-disposition:", header, 20) == 0
+@@ -700,22 +701,27 @@ while(1)
+ uschar * s = q;
+
+ /* look for a ' in the "filename" */
+- while(*s != '\'' && *s) s++; /* s is ' or NUL */
++ while(*s != '\'' && *s) s++; /* s is 1st ' or NUL */
+
+ if ((size = s-q) > 0)
+- {
+ mime_filename_charset = string_copyn(q, size);
+- p = s;
+
+- while(*p == '\'' && *p) p++; /* p is after ' */
+- }
++ if (*(p = s)) p++;
++ while(*p == '\'') p++; /* p is after 2nd ' */
+ }
+ else
+ p = q;
+
++ DEBUG(D_acl) debug_printf("MIME: charset %s fname '%s'\n",
++ mime_filename_charset ? mime_filename_charset : US"<NULL>", p);
++
+ temp_string = rfc2231_to_2047(p, mime_filename_charset, &slen);
+- temp_string = rfc2047_decode(temp_string, FALSE, NULL, 32,
++ DEBUG(D_acl) debug_printf("MIME: 2047-name %s\n", temp_string);
++
++ temp_string = rfc2047_decode(temp_string, FALSE, NULL, ' ',
+ NULL, &err_msg);
++ DEBUG(D_acl) debug_printf("MIME: plain-name %s\n", temp_string);
++
+ size = Ustrlen(temp_string);
+
+ if (size == slen)
+@@ -750,7 +756,7 @@ while(1)
+ &dummy_errstr)
+ : NULL;
+ DEBUG(D_acl) debug_printf(
+- " found %s MIME parameter in %s header, value '%s'\n",
++ "MIME: found %s parameter in %s header, value '%s'\n",
+ mp->name, mh->name, *mp->value);
+
+ break; /* done matching param names */
+@@ -768,7 +774,7 @@ while(1)
+ if (decoding_failed) mime_filename = mime_fname_rfc2231;
+
+ DEBUG(D_acl) debug_printf(
+- " found %s MIME parameter in %s header, value is '%s'\n",
++ "MIME: found %s parameter in %s header, value is '%s'\n",
+ "filename", mh->name, mime_filename);
+ }
+ }
+@@ -809,8 +815,9 @@ while(1)
+ (nested_context.boundary != NULL) &&
+ (Ustrncmp(mime_content_type,"multipart",9) == 0) )
+ {
+- DEBUG(D_acl) debug_printf("Entering multipart recursion, boundary '%s'\n",
+- nested_context.boundary);
++ DEBUG(D_acl)
++ debug_printf("MIME: Entering multipart recursion, boundary '%s'\n",
++ nested_context.boundary);
+
+ nested_context.context =
+ context && context->context == MBC_ATTACHMENT
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/exim.git/commitdiff/b8bf635f1debb1e55e732603b79b2a843c650294
More information about the pld-cvs-commit
mailing list