mirror of
https://github.com/php/php-src.git
synced 2026-04-24 16:38:25 +02:00
Re-fixed Bug #66481 (Calls to session_name() segfault when session.name is null)
This commit is contained in:
@@ -5,6 +5,10 @@ PHP NEWS
|
||||
- Core:
|
||||
. Fixed bug #66286 (Incorrect object comparison with inheritance). (Nikita)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #66481 (Calls to session_name() segfault when session.name is
|
||||
null). (Laruence)
|
||||
|
||||
?? ??? 2013, PHP 5.4.24
|
||||
|
||||
- Core:
|
||||
|
||||
@@ -618,11 +618,10 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */
|
||||
static PHP_INI_MH(OnUpdateName) /* {{{ */
|
||||
{
|
||||
/* Numeric session.name won't work at all */
|
||||
if (PG(modules_activated) &&
|
||||
(!new_value_length || is_numeric_string(new_value, new_value_length, NULL, NULL, 0))) {
|
||||
if ((!new_value_length || is_numeric_string(new_value, new_value_length, NULL, NULL, 0))) {
|
||||
int err_type;
|
||||
|
||||
if (stage == ZEND_INI_STAGE_RUNTIME) {
|
||||
if (stage == ZEND_INI_STAGE_RUNTIME || stage == ZEND_INI_STAGE_ACTIVATE || stage == ZEND_INI_STAGE_STARTUP) {
|
||||
err_type = E_WARNING;
|
||||
} else {
|
||||
err_type = E_ERROR;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #66481: Calls to session_name() segfault when session.name is null.
|
||||
--INI--
|
||||
session.name=
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(session_name("foo"));
|
||||
var_dump(session_name("bar"));
|
||||
--EXPECTF--
|
||||
PHP Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0
|
||||
|
||||
Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0
|
||||
string(9) "PHPSESSID"
|
||||
string(3) "foo"
|
||||
Reference in New Issue
Block a user