From 146517684d448fa693cee70c941fa93ee0844179 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 28 Sep 2005 22:31:29 +0000 Subject: Fixed possible GLOBALS variable override when register_globals are ON. Fixed possible register_globals toggle via parse_str(). --- main/php_variables.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'main/php_variables.c') diff --git a/main/php_variables.c b/main/php_variables.c index 3242c0724b..e7124700f9 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -118,6 +118,13 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, zval *track_vars_arra zval_dtor(val); return; } + + /* GLOBALS hijack attempt, reject parameter */ + if (symtable1 == EG(active_symbol_table) && !strcmp("GLOBALS", var)) { + zval_dtor(val); + return; + } + /* ensure that we don't have spaces or dots in the variable name (not binary safe) */ for (p=var; *p; p++) { switch (*p) { -- cgit v1.2.1