mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
MFH: Fixed possible GLOBALS variable override when register_globals are ON.
MFH: Fixed possible register_globals toggle via parse_str(). MFH: Fixed negative offset handling in substr_compare() function.
This commit is contained in:
parent
ba5f66777e
commit
1a04335ec2
3 changed files with 18 additions and 6 deletions
|
@ -99,6 +99,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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue