Skip to content

Commit ae792a0

Browse files
committed
Fixed SIGSEGV
1 parent 78ca1de commit ae792a0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ext/session/session.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,10 @@ PHPAPI void php_add_session_var(char *name, size_t namelen TSRMLS_DC)
328328
if (PG(register_globals)) {
329329
zval **sym_global = NULL;
330330

331-
zend_hash_find(&EG(symbol_table), name, namelen + 1,
332-
(void *) &sym_global);
333-
334-
if ((Z_TYPE_PP(sym_global) == IS_ARRAY && Z_ARRVAL_PP(sym_global) == &EG(symbol_table)) || *sym_global == PS(http_session_vars)) {
335-
return;
331+
if (zend_hash_find(&EG(symbol_table), name, namelen + 1, (void *) &sym_global) == SUCCESS) {
332+
if ((Z_TYPE_PP(sym_global) == IS_ARRAY && Z_ARRVAL_PP(sym_global) == &EG(symbol_table)) || *sym_global == PS(http_session_vars)) {
333+
return;
334+
}
336335
}
337336

338337
if (sym_global == NULL && sym_track == NULL) {

0 commit comments

Comments
 (0)