summaryrefslogtreecommitdiff
path: root/ext/standard/var_unserializer.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/var_unserializer.c')
-rw-r--r--ext/standard/var_unserializer.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index 03cf8dc60..2e8b6f62b 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:41:53 2013 */
+/* Generated by re2c 0.13.5 */
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
@@ -394,8 +394,13 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, long elements)
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);
@@ -615,10 +620,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')) {
@@ -636,6 +650,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;
@@ -647,6 +667,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) {