php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #71936
Patch http_raw_post_data_fix.patch revision 2016-04-01 00:34 UTC by mike dot laspina at gmail dot com

Patch http_raw_post_data_fix.patch for Reproducible crash Bug #71936

Patch version 2016-04-01 00:34 UTC

Return to Bug #71936 | Download this patch
Patch Revisions:

Developer: mike.laspina@gmail.com

--- a/main/php_content_types.c	2015-11-25 12:28:38.000000000 -0800
+++ b/main/php_content_types.c	2016-03-31 17:24:41.000000000 -0700
@@ -64,6 +64,10 @@
 			length = php_stream_copy_to_mem(SG(request_info).request_body, &data, PHP_STREAM_COPY_ALL, 0);
 			php_stream_rewind(SG(request_info).request_body);
 
+			if (!data) {
+				data = estrdup("");
+			}
+
 			if (length > INT_MAX) {
 				sapi_module.sapi_error(E_WARNING,
 					"HTTP_RAW_POST_DATA truncated from %lu to %d bytes",
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC