com php-src: Fix bug #67972 (SessionHandler Invalid memory read create_sid()).: NEWS ext/session/mod_user_c lass.c ext/session/tests/bug67972.phpt
| From: | Adam Harvey | Date: | Mon, 08 Sep 2014 19:25:14 +0000 |
| Subject: | com php-src: Fix bug #67972 (SessionHandler Invalid memory read create_sid()).: NEWS ext/session/mod_user_c lass.c ext/session/tests/bug67972.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81458@lists.php.net to get a copy of this message | ||
Commit: bc44eb61728951ffe789be91ea0142a4120afc50
Author: Adam Harvey <aharvey@php.net> Mon, 8 Sep 2014 19:25:14 +0000
Parents: b16929ca7294fb047e63eb6c04d715d980a50c47
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bc44eb61728951ffe789be91ea0142a4120afc50
Log:
Fix bug #67972 (SessionHandler Invalid memory read create_sid()).
SessionHandler::create_sid() didn't check if PS(default_mod) was initialised
before attempting to call its create_sid() handler.
Bugs:
https://bugs.php.net/67972
Changed paths:
M NEWS
M ext/session/mod_user_class.c
A ext/session/tests/bug67972.phpt
Diff:
diff --git a/NEWS b/NEWS
index de02064..f0a4379 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,8 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2014, PHP 5.5.18
-
+- Session:
+ . Fixed bug #67972 (SessionHandler Invalid memory read create_sid()). (Adam)
11 Sep 2014, PHP 5.5.17
diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c
index 3b66877..119a536 100644
--- a/ext/session/mod_user_class.c
+++ b/ext/session/mod_user_class.c
@@ -148,6 +148,8 @@ PHP_METHOD(SessionHandler, create_sid)
{
char *id;
+ PS_SANITY_CHECK;
+
if (zend_parse_parameters_none() == FAILURE) {
return;
}
diff --git a/ext/session/tests/bug67972.phpt b/ext/session/tests/bug67972.phpt
new file mode 100644
index 0000000..63ed3a9
--- /dev/null
+++ b/ext/session/tests/bug67972.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #67972: SessionHandler Invalid memory read create_sid()
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+
+(new SessionHandler)->create_sid();
+--EXPECTF--
+Fatal error: SessionHandler::create_sid(): Cannot call default session handler in %s on line %d