From: Xinchen Hui Date: Tue, 14 Aug 2012 16:15:34 +0000 (+0800) Subject: Fixed bug (segfault due to PS(mod_user_implemented) not be reseted when closing handl... X-Git-Tag: php-5.4.7RC1~66 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da3660a4c42cb90c8d5626ac1da71c1201f98d4b;p=php Fixed bug (segfault due to PS(mod_user_implemented) not be reseted when closing handler call exit) --- diff --git a/NEWS b/NEWS index da53df00c0..78b865212d 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,11 @@ PHP NEWS . Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong result). (Laruence) +- Session: + . Fixed bug (segfault due to PS(mod_user_implemented) not be reseted + when close handler call exit). (Laruence) + + ?? ??? 2012, PHP 5.4.6 - CLI Server: diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c index 2ff5302f78..41a63fc4b2 100644 --- a/ext/session/mod_user.c +++ b/ext/session/mod_user.c @@ -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,22 @@ 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; + PS(mod_user_implemented) = 0; + } zend_end_try(); + PS(mod_user_implemented) = 0; + if (bailout) { + if (retval) { + zval_ptr_dtor(&retval); + } + zend_bailout(); + } + FINISH; }