summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--ext/session/session.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 7bced946c3..713008bfbb 100644
--- 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
diff --git a/ext/session/session.c b/ext/session/session.c
index ce578d7191..5afdfd35f4 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -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.