diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-12-30 11:27:13 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-12-30 11:27:13 +0100 |
commit | ed3811e7819333cb097cb510cb8833527834c9a9 (patch) | |
tree | 93d6a29eae4640164697237134d359566a2eba7d /ext/session | |
parent | 935a61d03455abde63ef93b49a7e42541e71bfc0 (diff) | |
download | php-git-ed3811e7819333cb097cb510cb8833527834c9a9.tar.gz |
Revert "Increase serialize_lock while decoding session"
This reverts commit b8ef7c35abd31666d9fb317db4b09a9eef0ede6c.
See bug #79031. The semantics of serialize locking aren't quite
correct right now, and the use of the lock in this particular
place makes us hit the issue in a common case. I'm reverting this
commit for PHP 7.4 and will try to fix this properly for PHP 8,
as I believe it will require ABI breakage.
Diffstat (limited to 'ext/session')
-rw-r--r-- | ext/session/session.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/ext/session/session.c b/ext/session/session.c index 01c2d4b85a..671968e8da 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -244,18 +244,11 @@ static zend_string *php_session_encode(void) /* {{{ */ static int php_session_decode(zend_string *data) /* {{{ */ { - int res; if (!PS(serializer)) { php_error_docref(NULL, E_WARNING, "Unknown session.serialize_handler. Failed to decode session object"); return FAILURE; } - /* Make sure that any uses of unserialize() during session decoding do not share - * state with any unserialize() that is already in progress (e.g. because we are - * currently inside Serializable::unserialize(). */ - BG(serialize_lock)++; - res = PS(serializer)->decode(ZSTR_VAL(data), ZSTR_LEN(data)); - BG(serialize_lock)--; - if (res == FAILURE) { + if (PS(serializer)->decode(ZSTR_VAL(data), ZSTR_LEN(data)) == FAILURE) { php_session_destroy(); php_session_track_init(); php_error_docref(NULL, E_WARNING, "Failed to decode session object. Session has been destroyed"); |