fix crash, enable session_id and fix test

This commit is contained in:
Stanislav Malyshev 2013-08-04 17:43:20 -07:00
parent 82b0e8be99
commit b80d73ce15
3 changed files with 2 additions and 6 deletions

View file

@ -465,7 +465,7 @@ PS_CREATE_SID_FUNC(files)
do {
sid = php_session_create_id((void **)&data, newlen TSRMLS_CC);
/* Check collision */
if (ps_files_key_exists(data, sid TSRMLS_CC) == SUCCESS) {
if (data && ps_files_key_exists(data, sid TSRMLS_CC) == SUCCESS) {
if (sid) {
efree(sid);
sid = NULL;

View file

@ -1829,9 +1829,6 @@ static PHP_FUNCTION(session_id)
}
if (name) {
if (PS(use_strict_mode) && argc) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Set session ID while session.use_strict_mode is enabled");
}
if (PS(id)) {
efree(PS(id));
}

View file

@ -9,7 +9,6 @@ if(substr(PHP_OS, 0, 3) == "WIN")
session.save_handler=files
session.save_path=
session.name=PHPSESSID
open_basedir=.
--FILE--
<?php
@ -25,7 +24,7 @@ $directory = dirname(__FILE__);
$sessions = ($directory."/sessions");
chdir($directory);
ini_set('open_basedir', '.');
// Delete the existing directory
if (file_exists($sessions) === TRUE) {
@rmdir($sessions);