diff options
| author | Felipe Pena <felipe@php.net> | 2012-01-28 01:24:54 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2012-01-28 01:24:54 +0000 |
| commit | acaf9c5227d75321def26ec5631def2fbb58feb2 (patch) | |
| tree | d64f0d28e099c14f16c6f7ed37938d1c063990f5 | |
| parent | 544e36dfffaf975e32468a22ea46975956035dc1 (diff) | |
| download | php-git-acaf9c5227d75321def26ec5631def2fbb58feb2.tar.gz | |
- Fixed bug #60860 (session.save_handler=user without defined function core dumps)
| -rw-r--r-- | ext/session/mod_user.c | 7 | ||||
| -rw-r--r-- | ext/session/tests/bug60860.phpt | 17 |
2 files changed, 24 insertions, 0 deletions
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c index cf13e4b46e..2ff5302f78 100644 --- a/ext/session/mod_user.c +++ b/ext/session/mod_user.c @@ -80,6 +80,13 @@ PS_OPEN_FUNC(user) { zval *args[2]; STDVARS; + + 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 |
