diff options
Diffstat (limited to 'ext/session')
-rw-r--r-- | ext/session/mod_user.c | 17 | ||||
-rw-r--r-- | ext/session/session.c | 2 | ||||
-rw-r--r-- | ext/session/tests/bug60634_error_5.phpt | 2 |
3 files changed, 16 insertions, 5 deletions
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c index 2ff5302f78..84a28d3427 100644 --- a/ext/session/mod_user.c +++ b/ext/session/mod_user.c @@ -63,7 +63,7 @@ static zval *ps_call_handler(zval *func, int argc, zval **argv TSRMLS_DC) } #define STDVARS \ - zval *retval; \ + zval *retval = NULL; \ int ret = FAILURE #define PSF(a) PS(mod_user_names).name.ps_##a @@ -99,6 +99,7 @@ PS_OPEN_FUNC(user) PS_CLOSE_FUNC(user) { + zend_bool bailout = 0; STDVARS; if (!PS(mod_user_implemented)) { @@ -106,9 +107,21 @@ PS_CLOSE_FUNC(user) return SUCCESS; } - retval = ps_call_handler(PSF(close), 0, NULL TSRMLS_CC); + zend_try { + retval = ps_call_handler(PSF(close), 0, NULL TSRMLS_CC); + } zend_catch { + bailout = 1; + } zend_end_try(); + PS(mod_user_implemented) = 0; + if (bailout) { + if (retval) { + zval_ptr_dtor(&retval); + } + zend_bailout(); + } + FINISH; } diff --git a/ext/session/session.c b/ext/session/session.c index 7a8199d810..0c08d49681 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -59,7 +59,7 @@ #include "mod_mm.h" #endif -PHPAPI ZEND_DECLARE_MODULE_GLOBALS(ps); +PHPAPI ZEND_DECLARE_MODULE_GLOBALS(ps) static int php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra TSRMLS_DC); static int (*php_session_rfc1867_orig_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC); diff --git a/ext/session/tests/bug60634_error_5.phpt b/ext/session/tests/bug60634_error_5.phpt index 376b65f20b..8081ab988a 100644 --- a/ext/session/tests/bug60634_error_5.phpt +++ b/ext/session/tests/bug60634_error_5.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in close during exec ---XFAIL-- -Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID |