1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00

Merge branch 'PHP-5.6'

* PHP-5.6:
  Bug #66481 Segfaults on session_name()
This commit is contained in:
Yasuo Ohgaki
2014-01-16 11:35:57 +09:00
2 changed files with 23 additions and 0 deletions
+7
View File
@@ -689,6 +689,13 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */
static PHP_INI_MH(OnUpdateName) /* {{{ */
{
/* Don't accept a blank session name from php.ini or -d session.name= */
if (!PG(modules_activated) && !new_value_length) {
/* Force the default value. */
new_value = "PHPSESSID";
new_value_length = 9;
}
/* 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))) {
+16
View File
@@ -0,0 +1,16 @@
--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--
string(9) "PHPSESSID"
string(3) "foo"