From: Ilia Alshanetsky Date: Thu, 29 Jul 2004 00:35:07 +0000 (+0000) Subject: Fixed but #29437 (Possible crash inside array_walk_recursive()). X-Git-Tag: PRE_ZEND_VM_DISPATCH_PATCH~325 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=739696d2d7531ffb24269263fb5396a728943794;p=php Fixed but #29437 (Possible crash inside array_walk_recursive()). --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 84625ca71c..5ee9796357 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -996,7 +996,7 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive { zval **args[3], /* Arguments to userland function */ *retval_ptr, /* Return value - unused */ - *key; /* Entry key */ + *key=NULL; /* Entry key */ char *string_key; uint string_key_len; ulong num_key; @@ -1060,7 +1060,10 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive } } - zval_ptr_dtor(&key); + if (key) { + zval_ptr_dtor(&key); + key = NULL; + } zend_hash_move_forward_ex(target_hash, &pos); }