]> granicus.if.org Git - php/commitdiff
Properly initialize PS(mod) on RINIT
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 22 Mar 2021 12:21:07 +0000 (13:21 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Tue, 23 Mar 2021 12:12:19 +0000 (13:12 +0100)
We need to do that in case a user handler has been set.  However, we
can't do that in `php_rinit_session_globals()` since that function is
called by PHP function `session_destroy()` too, but in that case we
don't want to reset PS(mod).

Closes GH-6795.

ext/session/session.c

index ea9a1eede93ea4a953844136232ffa61303dae7a..8fb6dd2cd5d2a580011fb5176e8c955d59b66720 100644 (file)
@@ -2855,7 +2855,8 @@ static int php_rinit_session(zend_bool auto_start) /* {{{ */
 {
        php_rinit_session_globals();
 
-       if (PS(mod) == NULL) {
+       PS(mod) = NULL;
+       {
                char *value;
 
                value = zend_ini_string("session.save_handler", sizeof("session.save_handler") - 1, 0);