diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-07-21 21:47:52 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-07-21 21:47:52 +0000 |
commit | f9a8fc0c09d8c46f0da108c95a8751fe0aa57a6f (patch) | |
tree | 3915c520016a317b00a897c01cf2a7e08d3f70cf /ext/session/session.c | |
parent | 6175f0a4c9814d459fd29bfa30811dead3a648ba (diff) | |
download | php-git-f9a8fc0c09d8c46f0da108c95a8751fe0aa57a6f.tar.gz |
Fixed bug #24592 (Possible crash in session extnsion, with NULL values)
Diffstat (limited to 'ext/session/session.c')
-rw-r--r-- | ext/session/session.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/session/session.c b/ext/session/session.c index 066c4e90cf..f35fd9b454 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -734,9 +734,12 @@ static int migrate_global(HashTable *ht, HashPosition *pos TSRMLS_DC) switch (n) { case HASH_KEY_IS_STRING: - zend_hash_find(&EG(symbol_table), str, str_len, (void **) &val); - if (val) { - ZEND_SET_SYMBOL_WITH_LENGTH(ht, str, str_len, *val, (*val)->refcount + 1 , 1); + if (zend_hash_find(&EG(symbol_table), str, str_len, (void **) &val) == SUCCESS && val) { + if (!PZVAL_IS_REF(*val)) { + (*val)->is_ref = 1; + (*val)->refcount += 1; + zend_hash_update(ht, str, str_len, val, sizeof(zval *), NULL); + } ret = 1; } break; |