summaryrefslogtreecommitdiff
path: root/ext/session
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-08-02 09:16:52 +0000
committerAntony Dovgal <tony2001@php.net>2006-08-02 09:16:52 +0000
commit0c4ef446e2cdf23590f41cd785637c1bd7516ebd (patch)
tree5a6af562f65f8c0f05d7ceb6044c910d0d376944 /ext/session
parente17320651c654a8e72cafcf966f5d408208356b7 (diff)
downloadphp-git-0c4ef446e2cdf23590f41cd785637c1bd7516ebd.tar.gz
MFH: fix #38289 (segfault in session_decode() when _SESSION is NULL)
Diffstat (limited to 'ext/session')
-rw-r--r--ext/session/session.c10
1 files changed, 7 insertions, 3 deletions
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.