mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-5.6'
Conflicts: ext/readline/readline.c
This commit is contained in:
commit
fc087ed1ee
2 changed files with 14 additions and 2 deletions
|
@ -402,12 +402,13 @@ PHP_FUNCTION(readline_read_history)
|
|||
return;
|
||||
}
|
||||
|
||||
if (php_check_open_basedir(arg)) {
|
||||
if (arg && php_check_open_basedir(arg)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* XXX from & to NYI */
|
||||
if (read_history(arg)) {
|
||||
/* If filename is NULL, then read from `~/.history' */
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
RETURN_TRUE;
|
||||
|
@ -426,7 +427,7 @@ PHP_FUNCTION(readline_write_history)
|
|||
return;
|
||||
}
|
||||
|
||||
if (php_check_open_basedir(arg)) {
|
||||
if (arg && php_check_open_basedir(arg)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
|
11
ext/readline/tests/bug69054.phpt
Normal file
11
ext/readline/tests/bug69054.phpt
Normal 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==
|
Loading…
Add table
Add a link
Reference in a new issue