summaryrefslogtreecommitdiff
path: root/ext/spl/spl_array.c
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2014-08-25 11:37:32 +0200
committerOndřej Surý <ondrej@sury.org>2014-08-25 11:37:32 +0200
commit4b01785e700724da58ab36336a92a44c5d8246a8 (patch)
tree94beaa316d16d2a191164f26efc78b3a744718d0 /ext/spl/spl_array.c
parent66921ccd8c83bce7c509b6f005951c2fac8fbb80 (diff)
downloadphp-upstream/5.4.32.tar.gz
New upstream version 5.4.32upstream/5.4.32
Diffstat (limited to 'ext/spl/spl_array.c')
-rw-r--r--ext/spl/spl_array.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index bf034ab24..ec9ce217d 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -1745,6 +1745,7 @@ SPL_METHOD(Array, unserialize)
const unsigned char *p, *s;
php_unserialize_data_t var_hash;
zval *pmembers, *pflags = NULL;
+ HashTable *aht;
long flags;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
@@ -1756,6 +1757,12 @@ SPL_METHOD(Array, unserialize)
return;
}
+ aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ if (aht->nApplyCount > 0) {
+ zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
+ return;
+ }
+
/* storage */
s = p = (const unsigned char*)buf;
PHP_VAR_UNSERIALIZE_INIT(var_hash);