Patch zend_ini_parser.y.patch for Reproducible crash Bug #51588
Patch version 2010-04-18 10:29 UTC
Return to Bug #51588 |
Download this patch
Patch Revisions:
Developer: fat@php.net
--- Zend/zend_ini_parser.y.orig Fri Apr 16 02:56:49 2010
+++ Zend/zend_ini_parser.y Fri Apr 16 02:55:27 2010
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id$ */
+/* $Id: zend_ini_parser.y 293154 2010-01-05 20:40:23Z sebastian $ */
#define DEBUG_CFG_PARSER 0
@@ -194,11 +194,17 @@
int retval;
zend_ini_parser_param ini_parser_param;
+ if (CG(ini_parser_param)) {
+ ini_error("Unable to call recursively zend_parse_ini_file.");
+ return FAILURE;
+ }
+
ini_parser_param.ini_parser_cb = ini_parser_cb;
ini_parser_param.arg = arg;
CG(ini_parser_param) = &ini_parser_param;
if (zend_ini_open_file_for_scanning(fh, scanner_mode TSRMLS_CC) == FAILURE) {
+ CG(ini_parser_param) = NULL;
return FAILURE;
}
@@ -207,6 +213,7 @@
zend_file_handle_dtor(fh TSRMLS_CC);
shutdown_ini_scanner(TSRMLS_C);
+ CG(ini_parser_param) = NULL;
if (retval == 0) {
return SUCCESS;
@@ -223,11 +230,17 @@
int retval;
zend_ini_parser_param ini_parser_param;
+ if (CG(ini_parser_param)) {
+ ini_error("Unable to call recursively zend_parse_ini_string.");
+ return FAILURE;
+ }
+
ini_parser_param.ini_parser_cb = ini_parser_cb;
ini_parser_param.arg = arg;
CG(ini_parser_param) = &ini_parser_param;
if (zend_ini_prepare_string_for_scanning(str, scanner_mode TSRMLS_CC) == FAILURE) {
+ CG(ini_parser_param) = NULL;
return FAILURE;
}
@@ -235,6 +248,7 @@
retval = ini_parse(TSRMLS_C);
shutdown_ini_scanner(TSRMLS_C);
+ CG(ini_parser_param) = NULL;
if (retval == 0) {
return SUCCESS;
|