--- embedaddon/php/ext/standard/var_unserializer.c 2012/05/29 12:34:43 1.1.1.2 +++ embedaddon/php/ext/standard/var_unserializer.c 2013/07/22 01:32:05 1.1.1.3 @@ -1,9 +1,9 @@ -/* Generated by re2c 0.13.5 on Wed Nov 9 19:37:48 2011 */ +/* Generated by re2c 0.13.5 on Sat Mar 9 22:33:09 2013 */ /* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2012 The PHP Group | + | Copyright (c) 1997-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var_unserializer.c,v 1.1.1.2 2012/05/29 12:34:43 misho Exp $ */ +/* $Id: var_unserializer.c,v 1.1.1.3 2013/07/22 01:32:05 misho Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -394,9 +394,14 @@ static inline int object_common2(UNSERIALIZE_PARAMETER BG(serialize_lock)--; } - if (retval_ptr) + if (retval_ptr) { zval_ptr_dtor(&retval_ptr); + } + if (EG(exception)) { + return 0; + } + return finish_nested_data(UNSERIALIZE_PASSTHRU); } @@ -612,10 +617,22 @@ yy20: do { /* Try to find class directly */ + 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')) { @@ -630,7 +647,15 @@ yy20: args[0] = &arg_func_name; MAKE_STD_ZVAL(arg_func_name); ZVAL_STRING(arg_func_name, class_name, 1); + 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; @@ -638,8 +663,15 @@ yy20: zval_ptr_dtor(&arg_func_name); break; } + BG(serialize_lock) = 0; 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 */