From bc44eb61728951ffe789be91ea0142a4120afc50 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Mon, 8 Sep 2014 19:25:14 +0000 Subject: 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. --- ext/session/mod_user_class.c | 2 ++ ext/session/tests/bug67972.phpt | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 ext/session/tests/bug67972.phpt (limited to 'ext') diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c index 3b6687741e..119a536fb2 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 0000000000..63ed3a95b8 --- /dev/null +++ b/ext/session/tests/bug67972.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #67972: SessionHandler Invalid memory read create_sid() +--SKIPIF-- + +--FILE-- +create_sid(); +--EXPECTF-- +Fatal error: SessionHandler::create_sid(): Cannot call default session handler in %s on line %d -- cgit v1.2.1