]> granicus.if.org Git - php/commitdiff
- Fixed bug #54680 (missing TRACK_VARS_SERVER check)
authorFelipe Pena <felipe@php.net>
Sun, 12 Jun 2011 02:47:48 +0000 (02:47 +0000)
committerFelipe Pena <felipe@php.net>
Sun, 12 Jun 2011 02:47:48 +0000 (02:47 +0000)
ext/standard/basic_functions.c

index 321a89275c042c862f1b7b61c342ad1baffacbc3..cc16a33c2c94f513cf1dff30f166dc60e5ee05fb 100644 (file)
@@ -4258,7 +4258,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;