]> granicus.if.org Git - php/commitdiff
Fixed SIGSEGV
authorDmitry Stogov <dmitry@php.net>
Wed, 10 Jan 2007 07:04:49 +0000 (07:04 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 10 Jan 2007 07:04:49 +0000 (07:04 +0000)
ext/session/session.c

index 0a0c19979a3aa73c68e174bf6252b3058fed68ec..6b72224882c2dbcc520ba3022ab79cc6dead79b9 100644 (file)
@@ -328,11 +328,10 @@ PHPAPI void php_add_session_var(char *name, size_t namelen TSRMLS_DC)
        if (PG(register_globals)) {
                zval **sym_global = NULL;
                
-               zend_hash_find(&EG(symbol_table), name, namelen + 1, 
-                               (void *) &sym_global);
-                               
-               if ((Z_TYPE_PP(sym_global) == IS_ARRAY && Z_ARRVAL_PP(sym_global) == &EG(symbol_table)) || *sym_global == PS(http_session_vars)) {
-                       return;
+               if (zend_hash_find(&EG(symbol_table), name, namelen + 1, (void *) &sym_global) == SUCCESS) {                            
+                       if ((Z_TYPE_PP(sym_global) == IS_ARRAY && Z_ARRVAL_PP(sym_global) == &EG(symbol_table)) || *sym_global == PS(http_session_vars)) {
+                               return;
+                       }
                }
 
                if (sym_global == NULL && sym_track == NULL) {