diff options
Diffstat (limited to 'ext/spl/spl_array.c')
| -rw-r--r-- | ext/spl/spl_array.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 0c273a26b4..f6a38fb991 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -1710,7 +1710,7 @@ SPL_METHOD(Array, unserialize) size_t buf_len; const unsigned char *p, *s; php_unserialize_data_t var_hash; - zval members, zflags; + zval *members, *zflags; HashTable *aht; zend_long flags; @@ -1737,15 +1737,15 @@ SPL_METHOD(Array, unserialize) } ++p; - if (!php_var_unserialize(&zflags, &p, s + buf_len, &var_hash) || Z_TYPE(zflags) != IS_LONG) { + zflags = var_tmp_var(&var_hash); + if (!php_var_unserialize(zflags, &p, s + buf_len, &var_hash) || Z_TYPE_P(zflags) != IS_LONG) { goto outexcept; } - var_push_dtor(&var_hash, &zflags); --p; /* for ';' */ - flags = Z_LVAL(zflags); + flags = Z_LVAL_P(zflags); /* flags needs to be verified and we also need to verify whether the next - * thing we get is ';'. After that we require an 'm' or somethign else + * thing we get is ';'. After that we require an 'm' or something else * where 'm' stands for members and anything else should be an array. If * neither 'a' or 'm' follows we have an error. */ @@ -1777,19 +1777,15 @@ SPL_METHOD(Array, unserialize) } ++p; - ZVAL_UNDEF(&members); - if (!php_var_unserialize(&members, &p, s + buf_len, &var_hash) || Z_TYPE(members) != IS_ARRAY) { - zval_ptr_dtor(&members); + members = var_tmp_var(&var_hash); + if (!php_var_unserialize(members, &p, s + buf_len, &var_hash) || Z_TYPE_P(members) != IS_ARRAY) { goto outexcept; } - var_push_dtor(&var_hash, &members); /* copy members */ - object_properties_load(&intern->std, Z_ARRVAL(members)); - zval_ptr_dtor(&members); + object_properties_load(&intern->std, Z_ARRVAL_P(members)); /* done reading $serialized */ - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); return; |
