From bc6cb0c70da737dc97737b8f062e521dc4d2f6e1 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Sun, 12 Jun 2011 02:47:48 +0000 Subject: [PATCH] - Fixed bug #54680 (missing TRACK_VARS_SERVER check) --- ext/standard/basic_functions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 698234fe6e..2a26bc0272 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4196,7 +4196,8 @@ PHP_FUNCTION(getopt) /* Get argv from the global symbol table. We calculate argc ourselves * in order to be on the safe side, even though it is also available * from the symbol table. */ - if ((zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), (void **) &args) != FAILURE || + if (PG(http_globals)[TRACK_VARS_SERVER] && + (zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), (void **) &args) != FAILURE || zend_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void **) &args) != FAILURE) && Z_TYPE_PP(args) == IS_ARRAY ) { int pos = 0; -- 2.50.1