php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #67694
Patch write-short-circuit-fix revision 2014-08-23 14:18 UTC by tyrael@php.net
revision 2014-08-23 07:15 UTC by tyrael@php.net

Patch write-short-circuit-fix for Session related Bug #67694

Patch version 2014-08-23 14:18 UTC

Return to Bug #67694 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: tyrael@php.net

diff --git a/ext/session/session.c b/ext/session/session.c
index d1a7a07..a59eeb5 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -519,6 +519,7 @@ static void php_session_initialize(TSRMLS_D) /* {{{ */
                /* Store read data's MD5 hash */
                PHP_MD5Init(&context);
                PHP_MD5Update(&context, val, vallen);
+               PHP_MD5Update(&context, PS(id), sizeof(PS(id)));
                PHP_MD5Final(PS(session_data_hash), &context);

                php_session_decode(val, vallen TSRMLS_CC);
@@ -553,6 +554,7 @@ static void php_session_save_current_state(TSRMLS_D) /* {{{ */
                                /* Generate data's MD5 hash */
                                PHP_MD5Init(&context);
                                PHP_MD5Update(&context, val, vallen);
+                               PHP_MD5Update(&context, PS(id), sizeof(PS(id)));
                                PHP_MD5Final(digest, &context);
                                /* Write only when save is required */
                                if (memcmp(digest, PS(session_data_hash), 16)) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC