File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -402,12 +402,13 @@ PHP_FUNCTION(readline_read_history)
402
402
return ;
403
403
}
404
404
405
- if (php_check_open_basedir (arg )) {
405
+ if (arg && php_check_open_basedir (arg )) {
406
406
RETURN_FALSE ;
407
407
}
408
408
409
409
/* XXX from & to NYI */
410
410
if (read_history (arg )) {
411
+ /* If filename is NULL, then read from `~/.history' */
411
412
RETURN_FALSE ;
412
413
} else {
413
414
RETURN_TRUE ;
@@ -426,7 +427,7 @@ PHP_FUNCTION(readline_write_history)
426
427
return ;
427
428
}
428
429
429
- if (php_check_open_basedir (arg )) {
430
+ if (arg && php_check_open_basedir (arg )) {
430
431
RETURN_FALSE ;
431
432
}
432
433
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #69054 (Null dereference in readline_(read|write)_history() without parameters)
3
+ --SKIPIF--
4
+ <?php if (!extension_loaded ("readline " ) || !function_exists ('readline_add_history ' )) die ("skip " ); ?>
5
+ --INI--
6
+ open_basedir=/tmp
7
+ --FILE--
8
+ <?php readline_read_history (); ?>
9
+ ==DONE==
10
+ --EXPECT--
11
+ ==DONE==
You can’t perform that action at this time.
0 commit comments