summaryrefslogtreecommitdiff
path: root/main/php_variables.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2007-03-02 21:58:05 +0000
committerStanislav Malyshev <stas@php.net>2007-03-02 21:58:05 +0000
commit32fb34e2d1640b50ede5b8a7915ae761605f7a3c (patch)
treeb2799913aa1b94c7408988cd4e1d0752a26a60d5 /main/php_variables.c
parentf1d075a1027a85a75c7ed58a5025983950ab5ced (diff)
downloadphp-git-32fb34e2d1640b50ede5b8a7915ae761605f7a3c.tar.gz
limit nesting level of input variables
Diffstat (limited to 'main/php_variables.c')
-rw-r--r--main/php_variables.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/php_variables.c b/main/php_variables.c
index 9754b4f347..32acb140e9 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -119,10 +119,16 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, zval *track_vars_arra
index_len = var_len;
if (is_array) {
+ int nest_level = 0;
while (1) {
char *index_s;
int new_idx_len = 0;
+ if(++nest_level > PG(max_nesting_level)) {
+ /* too many levels of nesting */
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Input variable nesting level more than allowed %d (change max_input_nesting_level in php.ini to increase the limit)", PG(max_input_nesting_level));
+ }
+
ip++;
index_s = ip;
if (isspace(*ip)) {