Bug #72998 [NEW]: readline segfaults php on empty array returned from callback
| From: | lindsay at notion dot ai | Date: | Thu, 01 Sep 2016 21:04:22 +0000 |
| Subject: | Bug #72998 [NEW]: readline segfaults php on empty array returned from callback | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-203734@lists.php.net to get a copy of this message | ||
From: lindsay at notion dot ai
Operating system: osx 10.11.6
PHP version: 7.0.10
Package: Readline related
Bug Type: Bug
Bug description:readline segfaults php on empty array returned from callback
Description:
------------
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:
---------------
<?php
readline_completion_function('readline_callback');
do
{
$command = readline('> ');
echo 'command: ' . $command . PHP_EOL;
} while ($command);
function readline_callback($command)
{
return [];
}
--
Edit bug report at https://bugs.php.net/bug.php?id=72998&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72998&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72998&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72998&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72998&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72998&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72998&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72998&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72998&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72998&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72998&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72998&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72998&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72998&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72998&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72998&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72998&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72998&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72998&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72998&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72998&r=mysqlcfg