|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72998 readline segfaults php on empty array returned from callback
Submitted: 2016-09-01 21:04 UTC Modified: 2016-09-03 15:59 UTC
From: lindsay at notion dot ai Assigned:
Status: Closed Package: Readline related
PHP Version: 7.0.10 OS: Ubuntu 14.04.3 LTS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
40 - 27 = ?
Subscribe to this entry?

 [2016-09-01 21:04 UTC] lindsay at notion dot ai
If the callback for readline_completion_function returns an empty array, php will segfault.

When running the example code, hit tab to fire the callback.

Test script:


	$command = readline('> ');
	echo 'command: ' . $command . PHP_EOL;
} while ($command);

function readline_callback($command)
	return [];


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-02 22:16 UTC] lindsay at notion dot ai
-Operating System: osx 10.11.6 +Operating System: Ubuntu 14.04.3 LTS
 [2016-09-02 22:16 UTC] lindsay at notion dot ai
Incorrectly submitted ticket with my desktop os as osx.  I'm actually running this on linux ubuntu 14.04 kernel 3.19.0-25
 [2016-09-03 15:59 UTC]
I think this is libedit bug, (you are using libedit, right?)

seems it doesn't expect to accept an return like ["", NULL];
 [2021-06-03 08:34 UTC]
Automatic comment on behalf of krakjoe
Log: fix bug #72998
 [2021-06-03 08:34 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 19:01:28 2024 UTC