php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #64354
Patch bug64354.patch revision 2013-03-05 08:07 UTC by laruence@php.net

Patch bug64354.patch for Scripting Engine problem Bug #64354

Patch version 2013-03-05 08:07 UTC

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

Developer: laruence@php.net

diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index bd0b2f6..bd1a4ea 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Mon Jan 21 11:34:03 2013 */
+/* Generated by re2c 0.13.5 on Tue Mar  5 15:57:38 2013 */
 #line 1 "ext/standard/var_unserializer.re"
 /*
   +----------------------------------------------------------------------+
@@ -487,7 +487,7 @@ yy2:
 	yych = *(YYMARKER = ++YYCURSOR);
 	if (yych == ':') goto yy95;
 yy3:
-#line 759 "ext/standard/var_unserializer.re"
+#line 780 "ext/standard/var_unserializer.re"
 	{ return 0; }
 #line 493 "ext/standard/var_unserializer.c"
 yy4:
@@ -532,7 +532,7 @@ yy13:
 	goto yy3;
 yy14:
 	++YYCURSOR;
-#line 753 "ext/standard/var_unserializer.re"
+#line 774 "ext/standard/var_unserializer.re"
 	{
 	/* this is the case where we have less data than planned */
 	php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
@@ -623,10 +623,19 @@ yy20:
 		BG(serialize_lock) = 1;
 		if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
 			BG(serialize_lock) = 0;
+			if (EG(exception)) {
+				efree(class_name);
+				return 0;
+			}
 			ce = *pce;
 			break;
 		}
 		BG(serialize_lock) = 0;
+
+		if (EG(exception)) {
+			efree(class_name);
+			return 0;
+		}
 		
 		/* Check for unserialize callback */
 		if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) {
@@ -644,6 +653,12 @@ yy20:
 		BG(serialize_lock) = 1;
 		if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
 			BG(serialize_lock) = 0;
+			if (EG(exception)) {
+				efree(class_name);
+				zval_ptr_dtor(&user_func);
+				zval_ptr_dtor(&arg_func_name);
+				return 0;
+			}
 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val);
 			incomplete_class = 1;
 			ce = PHP_IC_ENTRY;
@@ -655,6 +670,12 @@ yy20:
 		if (retval_ptr) {
 			zval_ptr_dtor(&retval_ptr);
 		}
+		if (EG(exception)) {
+			efree(class_name);
+			zval_ptr_dtor(&user_func);
+			zval_ptr_dtor(&arg_func_name);
+			return 0;
+		}
 		
 		/* The callback function may have defined the class */
 		if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
@@ -691,7 +712,7 @@ yy20:
 
 	return object_common2(UNSERIALIZE_PASSTHRU, elements);
 }
-#line 695 "ext/standard/var_unserializer.c"
+#line 716 "ext/standard/var_unserializer.c"
 yy25:
 	yych = *++YYCURSOR;
 	if (yych <= ',') {
@@ -724,7 +745,7 @@ yy27:
 	return object_common2(UNSERIALIZE_PASSTHRU,
 			object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
 }
-#line 728 "ext/standard/var_unserializer.c"
+#line 749 "ext/standard/var_unserializer.c"
 yy32:
 	yych = *++YYCURSOR;
 	if (yych == '+') goto yy33;
@@ -765,7 +786,7 @@ yy34:
 
 	return finish_nested_data(UNSERIALIZE_PASSTHRU);
 }
-#line 769 "ext/standard/var_unserializer.c"
+#line 790 "ext/standard/var_unserializer.c"
 yy39:
 	yych = *++YYCURSOR;
 	if (yych == '+') goto yy40;
@@ -815,7 +836,7 @@ yy41:
 	ZVAL_STRINGL(*rval, str, len, 0);
 	return 1;
 }
-#line 819 "ext/standard/var_unserializer.c"
+#line 840 "ext/standard/var_unserializer.c"
 yy46:
 	yych = *++YYCURSOR;
 	if (yych == '+') goto yy47;
@@ -864,7 +885,7 @@ yy48:
 	ZVAL_STRINGL(*rval, str, len, 1);
 	return 1;
 }
-#line 868 "ext/standard/var_unserializer.c"
+#line 889 "ext/standard/var_unserializer.c"
 yy53:
 	yych = *++YYCURSOR;
 	if (yych <= '/') {
@@ -962,7 +983,7 @@ use_double:
 	ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
 	return 1;
 }
-#line 966 "ext/standard/var_unserializer.c"
+#line 987 "ext/standard/var_unserializer.c"
 yy65:
 	yych = *++YYCURSOR;
 	if (yych <= ',') {
@@ -1036,7 +1057,7 @@ yy73:
 
 	return 1;
 }
-#line 1040 "ext/standard/var_unserializer.c"
+#line 1061 "ext/standard/var_unserializer.c"
 yy76:
 	yych = *++YYCURSOR;
 	if (yych == 'N') goto yy73;
@@ -1090,7 +1111,7 @@ yy79:
 	ZVAL_LONG(*rval, parse_iv(start + 2));
 	return 1;
 }
-#line 1094 "ext/standard/var_unserializer.c"
+#line 1115 "ext/standard/var_unserializer.c"
 yy83:
 	yych = *++YYCURSOR;
 	if (yych <= '/') goto yy18;
@@ -1105,7 +1126,7 @@ yy83:
 	ZVAL_BOOL(*rval, parse_iv(start + 2));
 	return 1;
 }
-#line 1109 "ext/standard/var_unserializer.c"
+#line 1130 "ext/standard/var_unserializer.c"
 yy87:
 	++YYCURSOR;
 #line 479 "ext/standard/var_unserializer.re"
@@ -1115,7 +1136,7 @@ yy87:
 	ZVAL_NULL(*rval);
 	return 1;
 }
-#line 1119 "ext/standard/var_unserializer.c"
+#line 1140 "ext/standard/var_unserializer.c"
 yy89:
 	yych = *++YYCURSOR;
 	if (yych <= ',') {
@@ -1161,7 +1182,7 @@ yy91:
 	
 	return 1;
 }
-#line 1165 "ext/standard/var_unserializer.c"
+#line 1186 "ext/standard/var_unserializer.c"
 yy95:
 	yych = *++YYCURSOR;
 	if (yych <= ',') {
@@ -1205,9 +1226,9 @@ yy97:
 	
 	return 1;
 }
-#line 1209 "ext/standard/var_unserializer.c"
+#line 1230 "ext/standard/var_unserializer.c"
 }
-#line 761 "ext/standard/var_unserializer.re"
+#line 782 "ext/standard/var_unserializer.re"
 
 
 	return 0;
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index 2049957..caa3524 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -681,10 +681,19 @@ object ":" uiv ":" ["]	{
 		BG(serialize_lock) = 1;
 		if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
 			BG(serialize_lock) = 0;
+			if (EG(exception)) {
+				efree(class_name);
+				return 0;
+			}
 			ce = *pce;
 			break;
 		}
 		BG(serialize_lock) = 0;
+
+		if (EG(exception)) {
+			efree(class_name);
+			return 0;
+		}
 		
 		/* Check for unserialize callback */
 		if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) {
@@ -702,6 +711,12 @@ object ":" uiv ":" ["]	{
 		BG(serialize_lock) = 1;
 		if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
 			BG(serialize_lock) = 0;
+			if (EG(exception)) {
+				efree(class_name);
+				zval_ptr_dtor(&user_func);
+				zval_ptr_dtor(&arg_func_name);
+				return 0;
+			}
 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val);
 			incomplete_class = 1;
 			ce = PHP_IC_ENTRY;
@@ -713,6 +728,12 @@ object ":" uiv ":" ["]	{
 		if (retval_ptr) {
 			zval_ptr_dtor(&retval_ptr);
 		}
+		if (EG(exception)) {
+			efree(class_name);
+			zval_ptr_dtor(&user_func);
+			zval_ptr_dtor(&arg_func_name);
+			return 0;
+		}
 		
 		/* The callback function may have defined the class */
 		if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC