diff options
author | Remi Collet <remi@php.net> | 2014-01-20 08:38:53 +0100 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2014-01-20 08:38:53 +0100 |
commit | 31d67bd35362c1ab570caccedfec3e24257b55c5 (patch) | |
tree | 1539db085dbd39daa28fef983ec2be73fe1e1cb5 /ext/readline/readline.c | |
parent | 4e55c6bffb9407b3013c90fcf3a840bfc5115ca2 (diff) | |
download | php-git-31d67bd35362c1ab570caccedfec3e24257b55c5.tar.gz |
Fixed Bug #66412 readline_clear_history() with libedit causes segfault after #65714
Checking all libedit functions, this check is done in each functions (add_history,
read_history, write_history, ...) but is missing in clear_history.
Test coverage: readline_clear_history_001.phpt
Diffstat (limited to 'ext/readline/readline.c')
-rw-r--r-- | ext/readline/readline.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c index ecd5533350..4bd9103462 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -354,6 +354,11 @@ PHP_FUNCTION(readline_clear_history) return; } +#if HAVE_LIBEDIT + /* clear_history is the only function where rl_initialize + is not call to ensure correct allocation */ + using_history(); +#endif clear_history(); RETURN_TRUE; |