php.net |  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
Votes:1
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: carlosv775 at gmail dot com
New email:
PHP Version: OS:

 

 [2021-02-28 02:30 UTC] carlosv775 at gmail dot com
Description:
------------
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:
https://github.com/cviniciussdias/php-text-to-speech/issues/2

And can be reproduced here:
https://3v4l.org/NeONG

Test script:
---------------
<?php

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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-03-01 14:02 UTC] nikic@php.net
-Assigned To: +Assigned To: nikic
 [2021-03-01 15:30 UTC] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=75a4f484f058f50fa1bb70c1eb5388409910203b
Log: Fixed bug #80811
 [2021-03-01 15:30 UTC] nikic@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC