]> granicus.if.org Git - php/commitdiff
Fixed bug (segfault due to PS(mod_user_implemented) not be reseted when closing handl...
authorXinchen Hui <laruence@php.net>
Tue, 14 Aug 2012 16:15:34 +0000 (00:15 +0800)
committerXinchen Hui <laruence@php.net>
Tue, 14 Aug 2012 16:15:34 +0000 (00:15 +0800)
NEWS
ext/session/mod_user.c

diff --git a/NEWS b/NEWS
index da53df00c0ae2941d81c651c582c92c69e880d05..78b865212d555eb13de073711e76c6f789588059 100644 (file)
--- 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:
index 2ff5302f7820490602d1476d87a94fd405551552..41a63fc4b2b5beabecec342276f335e6e0bba429 100644 (file)
@@ -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;
 }