|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80811 Function exec without $output but with $restult_code parameter crashes
Submitted: 2021-02-28 02:30 UTC Modified: 2021-03-01 14:02 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: carlosv775 at gmail dot com Assigned: nikic (profile)
Status: Closed Package: Reproducible crash
PHP Version: 8.0.2 OS:
Private report: No CVE-ID: None
 [2021-02-28 02:30 UTC] carlosv775 at gmail dot com
If we execute the function `exec` passing the `$result_code` but not passing the `$output`, it gives us a segfault error. This was discovered here:

And can be reproduced here:

Test script:

echo 'Executing with all params:' . PHP_EOL;
exec('echo Something', output: $output, result_code: $resultCode);

echo 'Executing without output param:' . PHP_EOL;
exec('echo Something', result_code: $resultCode);

echo 'The End';

Expected result:
No errors should be displayed and the command should be executed.

Actual result:
Process exited with code 139.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-03-01 14:02 UTC]
-Assigned To: +Assigned To: nikic
 [2021-03-01 15:30 UTC]
Automatic comment on behalf of
Log: Fixed bug #80811
 [2021-03-01 15:30 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 25 13:01:31 2024 UTC