Merge branch 'PHP-5.5' into PHP-5.6

This commit is contained in:
Xinchen Hui 2015-02-15 22:55:42 +08:00
commit edd16831b1
2 changed files with 14 additions and 2 deletions

View File

@ -400,12 +400,13 @@ PHP_FUNCTION(readline_read_history)
return;
}
if (php_check_open_basedir(arg TSRMLS_CC)) {
if (arg && php_check_open_basedir(arg TSRMLS_CC)) {
RETURN_FALSE;
}
/* XXX from & to NYI */
if (read_history(arg)) {
/* If filename is NULL, then read from `~/.history' */
RETURN_FALSE;
} else {
RETURN_TRUE;
@ -424,7 +425,7 @@ PHP_FUNCTION(readline_write_history)
return;
}
if (php_check_open_basedir(arg TSRMLS_CC)) {
if (arg && php_check_open_basedir(arg TSRMLS_CC)) {
RETURN_FALSE;
}

View File

@ -0,0 +1,11 @@
--TEST--
Bug #69054 (Null dereference in readline_(read|write)_history() without parameters)
--SKIPIF--
<?php if (!extension_loaded("readline") || !function_exists('readline_add_history')) die("skip"); ?>
--INI--
open_basedir=/tmp
--FILE--
<?php readline_read_history(); ?>
==DONE==
--EXPECT--
==DONE==