components/php-5_2/php-sapi/patches/f0_php_21296988.patch
branchs11u2-sru
changeset 4673 7ca7277ea064
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/php-5_2/php-sapi/patches/f0_php_21296988.patch	Mon Jul 20 09:11:32 2015 -0700
@@ -0,0 +1,38 @@
+Community BUG:
+https://bugs.php.net/bug.php?id=69364
+Patch from another source:
+https://github.com/80vul/phpcodz/blob/master/research/cve-2015-4024.patch.diff
+
+
+### fix CVE-2015-4024 patch for PHP 5.2/5.3 series @chtg
+
+--- php-5.3.29/main/rfc1867.c_orig
++++ php-5.3.29/main/rfc1867.c
+@@ -464,6 +464,8 @@ static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header T
+ 	char *line;
+ 	mime_header_entry prev_entry, entry;
+ 	int prev_len, cur_len;
++	int newlines = 0;
++	long upload_max_newlines = 100;
+ 
+ 	/* didn't find boundary, abort */
+ 	if (!find_boundary(self, self->boundary TSRMLS_CC)) {
+@@ -489,6 +491,7 @@ static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header T
+ 
+ 			entry.value = estrdup(value);
+ 			entry.key = estrdup(key);
++			newlines = 0;
+ 
+ 		} else if (zend_llist_count(header)) { /* If no ':' on the line, add to previous line */
+ 
+@@ -501,6 +504,10 @@ static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header T
+ 			entry.value[cur_len + prev_len] = '\0';
+ 
+ 			entry.key = estrdup(prev_entry.key);
++			newlines++;
++			if (newlines > upload_max_newlines) {
++				return 0;
++			}
+ 
+ 			zend_llist_remove_tail(header);
+ 		} else {