Bug #80811 [NEW]: Function exec without $output but with $restult_code parameter crashes

From: Date: Sun, 28 Feb 2021 02:30:32 +0000
Subject: Bug #80811 [NEW]: Function exec without $output but with $restult_code parameter crashes
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232420@lists.php.net to get a copy of this message
From:             carlosv775 at gmail dot com
Operating system: 
PHP version:      8.0.2
Package:          Reproducible crash
Bug Type:         Bug
Bug description:Function exec without $output but with $restult_code parameter crashes

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.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=80811&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80811&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80811&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80811&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80811&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80811&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80811&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80811&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80811&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80811&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80811&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80811&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80811&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80811&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80811&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80811&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80811&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80811&r=mysqlcfg


Thread (2 messages)

« previous php.bugs (#232420) next »