summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--ext/session/mod_user.c7
-rw-r--r--ext/session/tests/bug60860.phpt17
3 files changed, 27 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 997da8c578..5ee5938ddd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ?? 2012, PHP 5.3.10
+- Session:
+ . Fixed bug #60860 (session.save_handler=user without defined function core
+ dumps). (Felipe)
- Core:
. Fixed bug #60227 (header() cannot detect the multi-line header with CR).
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c
index bcabe2c96c..17af624998 100644
--- a/ext/session/mod_user.c
+++ b/ext/session/mod_user.c
@@ -86,6 +86,13 @@ PS_OPEN_FUNC(user)
zval *args[2];
static char dummy = 0;
STDVARS1;
+
+ if (PSF(open) == NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ "user session functions not defined");
+
+ return FAILURE;
+ }
SESS_ZVAL_STRING((char*)save_path, args[0]);
SESS_ZVAL_STRING((char*)session_name, args[1]);
diff --git a/ext/session/tests/bug60860.phpt b/ext/session/tests/bug60860.phpt
new file mode 100644
index 0000000000..12310205aa
--- /dev/null
+++ b/ext/session/tests/bug60860.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #60860 (session.save_handler=user without defined function core dumps)
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--INI--
+session.save_handler=user
+--FILE--
+<?php
+
+session_start();
+echo "ok\n";
+
+?>
+--EXPECTF--
+Warning: session_start(): user session functions not defined in %s on line 3
+
+Fatal error: session_start(): Failed to initialize storage module: user (path: ) in %s on line 3