summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott MacVicar <scottmac@php.net>2008-04-15 00:59:04 +0000
committerScott MacVicar <scottmac@php.net>2008-04-15 00:59:04 +0000
commit944061ba37ee68e093eadd5538e3854c08f71461 (patch)
tree52056e9d1d5c40c874f5b43b5557d80768955c8f
parentf0563a20682915c874b9ed8a4ae3f96ce35cf3ea (diff)
downloadphp-git-944061ba37ee68e093eadd5538e3854c08f71461.tar.gz
Fixed bug #44720 (Prevent infinite recursion within session_register)
-rw-r--r--ext/session/session.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/session/session.c b/ext/session/session.c
index 65ac1c29b8..f241237895 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -1655,12 +1655,19 @@ static void php_register_var(zval** entry TSRMLS_DC)
zval **value;
if (Z_TYPE_PP(entry) == IS_ARRAY) {
+ if (Z_ARRVAL_PP(entry)->nApplyCount > 1) {
+ return;
+ }
+
zend_hash_internal_pointer_reset(Z_ARRVAL_PP(entry));
+ Z_ARRVAL_PP(entry)->nApplyCount++;
while (zend_hash_get_current_data(Z_ARRVAL_PP(entry), (void**)&value) == SUCCESS) {
php_register_var(value TSRMLS_CC);
zend_hash_move_forward(Z_ARRVAL_PP(entry));
}
+
+ Z_ARRVAL_PP(entry)->nApplyCount--;
} else {
convert_to_string_ex(entry);