]> granicus.if.org Git - php/commitdiff
MFH: fix #38289 (segfault in session_decode() when _SESSION is NULL)
authorAntony Dovgal <tony2001@php.net>
Wed, 2 Aug 2006 09:16:52 +0000 (09:16 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 2 Aug 2006 09:16:52 +0000 (09:16 +0000)
NEWS
ext/session/session.c

diff --git a/NEWS b/NEWS
index 7bced946c32fbebf22f0e2b50ee9d51b0c2bf8ad..713008bfbb46b3d098965904460aa6ac2fbdcdd1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,8 @@ PHP                                                                        NEWS
 - Fixed phpinfo() cutoff of variables at \0. (Ilia)
 - Fixed a bug in the filter extension that prevented magic_quotes_gpc from
   being applied when RAW filter is used. (Ilia)
+- Fixed bug #38289 (segfault in session_decode() when _SESSION is NULL). 
+  (Tony)
 - Fixed bug #38278 (session_cache_expire()'s value does not match phpinfo's 
   session.cache_expire). (Tony)
 - Fixed bug #38269 (fopen wrapper doesn't fail on invalid hostname with 
index ce578d7191c147abfb780a3a1803c197caa3e65c..5afdfd35f400bd6aa44f79be84d4c90da3b80a31 100644 (file)
@@ -285,9 +285,13 @@ typedef struct {
 PHPAPI void php_add_session_var(char *name, size_t namelen TSRMLS_DC)
 {
        zval **sym_track = NULL;
-       
-       zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1, 
-                       (void *) &sym_track);
+
+       IF_SESSION_VARS() {
+               zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1, 
+                               (void *) &sym_track);
+       } else {
+               return;
+       }
 
        /*
         * Set up a proper reference between $_SESSION["x"] and $x.