summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Ullmann <jokey@gentoo.org>2007-09-05 15:47:39 +0000
committerMarkus Ullmann <jokey@gentoo.org>2007-09-05 15:47:39 +0000
commit01790785a80664807517e8281f20710a1afe0464 (patch)
tree4ed8ba92ef25038b9c432b3594145e7fade2e136 /dev-php4
parentStable for HPPA (bug #189738). (diff)
downloadgentoo-2-01790785a80664807517e8281f20710a1afe0464.tar.gz
gentoo-2-01790785a80664807517e8281f20710a1afe0464.tar.bz2
gentoo-2-01790785a80664807517e8281f20710a1afe0464.zip
Add missing patches to fix bug #191377
(Portage version: 2.1.3.7)
Diffstat (limited to 'dev-php4')
-rw-r--r--dev-php4/pecl-mailparse/ChangeLog7
-rw-r--r--dev-php4/pecl-mailparse/files/mailparse-c-64bit-segfault.diff48
-rw-r--r--dev-php4/pecl-mailparse/files/mailparse_mime-rfc2231.diff97
3 files changed, 151 insertions, 1 deletions
diff --git a/dev-php4/pecl-mailparse/ChangeLog b/dev-php4/pecl-mailparse/ChangeLog
index ae91f2118812..f09b3e94c276 100644
--- a/dev-php4/pecl-mailparse/ChangeLog
+++ b/dev-php4/pecl-mailparse/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-php4/pecl-mailparse
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-php4/pecl-mailparse/ChangeLog,v 1.10 2007/09/04 17:29:00 jokey Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-php4/pecl-mailparse/ChangeLog,v 1.11 2007/09/05 15:47:39 jokey Exp $
+
+ 05 Sep 2007; Markus Ullmann <jokey@gentoo.org>
+ +files/mailparse-c-64bit-segfault.diff,
+ +files/mailparse_mime-rfc2231.diff:
+ Add missing patches to fix bug #191377
*pecl-mailparse-2.1.1-r1 (04 Sep 2007)
diff --git a/dev-php4/pecl-mailparse/files/mailparse-c-64bit-segfault.diff b/dev-php4/pecl-mailparse/files/mailparse-c-64bit-segfault.diff
new file mode 100644
index 000000000000..f150a0dbbbf8
--- /dev/null
+++ b/dev-php4/pecl-mailparse/files/mailparse-c-64bit-segfault.diff
@@ -0,0 +1,48 @@
+--- mailparse-1.49.c 2006-09-30 18:42:45.000000000 +0400
++++ mailparse.c 2006-09-30 22:03:37.000000000 +0400
+@@ -231,7 +231,7 @@
+ php_mimepart *part;
+ zval *zpart;
+ char *mode;
+- long mode_len;
++ int mode_len;
+ zval *source = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz!", &mode,&mode_len, &source) == FAILURE)
+@@ -839,7 +839,7 @@
+ PHP_FUNCTION(mailparse_rfc822_parse_addresses)
+ {
+ char *addresses;
+- long addresses_len;
++ int addresses_len;
+ php_rfc822_tokenized_t *toks = NULL;
+ php_rfc822_addresses_t *addrs = NULL;
+ int i;
+@@ -1031,7 +1031,7 @@
+ PHP_FUNCTION(mailparse_msg_parse)
+ {
+ char *data;
+- long data_len;
++ int data_len;
+ zval *arg;
+ php_mimepart *part;
+
+@@ -1053,7 +1053,7 @@
+ PHP_FUNCTION(mailparse_msg_parse_file)
+ {
+ char *filename;
+- long filename_len;
++ int filename_len;
+ php_mimepart *part;
+ char *filebuf;
+ php_stream *stream;
+@@ -1501,7 +1501,7 @@
+ zval *arg;
+ php_mimepart *part, *foundpart;
+ char *mimesection;
+- long mimesection_len;
++ int mimesection_len;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &arg,&mimesection, &mimesection_len) == FAILURE) {
+ RETURN_FALSE;
+
diff --git a/dev-php4/pecl-mailparse/files/mailparse_mime-rfc2231.diff b/dev-php4/pecl-mailparse/files/mailparse_mime-rfc2231.diff
new file mode 100644
index 000000000000..068dc5be3807
--- /dev/null
+++ b/dev-php4/pecl-mailparse/files/mailparse_mime-rfc2231.diff
@@ -0,0 +1,97 @@
+--- php_mailparse_mime.c.orig Mon Feb 28 14:21:45 2005
++++ php_mailparse_mime.c Fri Dec 15 10:57:16 2006
+@@ -54,7 +54,11 @@
+ {
+ struct php_mimeheader_with_attributes *attr;
+ int i, first_semi, next_semi, comments_before_semi, netscape_bug = 0;
+-
++ char *name_buf = NULL;
++ smart_str value_buf = {0};
++ int is_rfc2231_name = 0;
++ char *check_name;
++
+ attr = ecalloc(1, sizeof(struct php_mimeheader_with_attributes));
+
+ MAKE_STD_ZVAL(attr->attributes);
+@@ -106,7 +110,7 @@
+
+ /* count those tokens; we expect "token = token" (3 tokens); if there are
+ * more than that, then something is quite possibly wrong - Netscape Bug! */
+- if (next_semi <= toks->ntokens
++ if (next_semi < toks->ntokens
+ && toks->tokens[next_semi].token != ';'
+ && next_semi - first_semi - comments_before_semi > 3) {
+ next_semi = i + 1;
+@@ -117,9 +121,56 @@
+ PHP_RFC822_RECOMBINE_STRTOLOWER|PHP_RFC822_RECOMBINE_IGNORE_COMMENTS);
+ value = php_rfc822_recombine_tokens(toks, i, next_semi - i,
+ PHP_RFC822_RECOMBINE_IGNORE_COMMENTS);
+-
+- add_assoc_string(attr->attributes, name, value, 0);
+- efree(name);
++
++ /* support rfc2231 mime parameter value
++ *
++ * Parameter Value Continuations:
++ *
++ * Content-Type: message/external-body; access-type=URL;
++ * URL*0="ftp://";
++ * URL*1="cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar"
++ *
++ * is semantically identical to
++ *
++ * Content-Type: message/external-body; access-type=URL;
++ * URL="ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar"
++ *
++ * Parameter Value Character Set and Language Information:
++ *
++ * Content-Type: application/x-stuff;
++ * title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A
++ *
++ * Modify by Zhao Wei
++ * E-mail: zhaowei@eyou.net
++ */
++ check_name = name;
++ while (*check_name) {
++ if (*check_name == '*')
++ break;
++ check_name++;
++ }
++ if (*check_name == '*') {
++ *check_name = 0;
++ if (NULL == name_buf)
++ name_buf = name;
++ else
++ efree(name);
++ smart_str_appends(&value_buf, value);
++ efree(value);
++ is_rfc2231_name = 1;
++ }
++
++ if (1 == is_rfc2231_name) {
++ if (*name != 0 && strcmp(name_buf, name) != 0) {
++ add_assoc_string(attr->attributes, name_buf, estrndup(value_buf.c, value_buf.len), 0);
++ efree(name_buf);
++ smart_str_free(&value_buf);
++ is_rfc2231_name = 0;
++ }
++ } else {
++ add_assoc_string(attr->attributes, name, value, 0);
++ efree(name);
++ }
+ }
+ }
+ if (next_semi < toks->ntokens && !netscape_bug)
+@@ -128,6 +179,13 @@
+ first_semi = next_semi;
+ netscape_bug = 0;
+ }
++ if (1 == is_rfc2231_name) {
++ add_assoc_string(attr->attributes, name_buf, estrndup(value_buf.c, value_buf.len), 0);
++ efree(name_buf);
++ smart_str_free(&value_buf);
++ }
++
++
+ return attr;
+ }