Skip to content

Commit 990f704

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #33958 (duplicate cookies and magic_quotes=off may cause a crash)
1 parent 9f6e059 commit 990f704

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ PHP NEWS
33
?? ??? 2005, PHP 5.1
44
- Fixed bug #33967 (misuse of Exception constructor doesn't display errorfile).
55
(Jani)
6+
- Fixed bug #33958 (duplicate cookies and magic_quotes=off may cause a crash).
7+
(Ilia)
68
- Fixed bug #33917 (number_format() output with > 1 char separators). (Jani)
79
- Fixed bug #33904 (input array keys being escaped when magic quotes is off).
810
(Ilia)

main/php_variables.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, zval *track_vars_arra
198198
*/
199199
if (PG(http_globals)[TRACK_VARS_COOKIE] && symtable1 == Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) &&
200200
zend_symtable_find(symtable1, escaped_index, index_len+1, (void **) &tmp) != FAILURE) {
201-
efree(escaped_index);
201+
if (PG(magic_quotes_gpc)) {
202+
efree(escaped_index);
203+
}
202204
break;
203205
}
204206
zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);

0 commit comments

Comments
 (0)