php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64677 execution operator `` stealing surrounding arguments
Submitted: 2013-04-20 04:41 UTC Modified: 2013-04-20 06:58 UTC
From: knivey at botops dot net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.5.0beta3 OS: Ubuntu 12.04LTS
Private report: No CVE-ID: None
 [2013-04-20 04:41 UTC] knivey at botops dot net
Description:
------------
When used the execution operator ` as an argument passed to a class method, you will end up with a seg fault or invalid args to shell_exec error

Test script:
---------------
<?PHP
class cat {
  public function show_output($prepend, $output = '') {echo $prepend . $output;}
  public function show_out($output) {echo $output;}
}
$cat = new cat();
$cat->show_output('Files: ', trim(`ls`)); // this gives invalid args to shell_exec
$cat->show_output('Files: ', `ls`); // this causes a segmentation fault
$cat->show_out(`ls`); // this causes a segmentation fault

function show_outputa($prepend, $output) {echo $prepend . $output;}
show_outputa('Files: ', `ls`); // this works as expected



Patches

bug64677.diff (last revision 2013-04-20 07:00 UTC by laruence@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-20 07:00 UTC] laruence@php.net
The following patch has been added/updated:

Patch Name: bug64677.diff
Revision:   1366441202
URL:        https://bugs.php.net/patch-display.php?bug=64677&patch=bug64677.diff&revision=1366441202
 [2013-04-20 07:24 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2013-04-20 07:24 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6ed16753c146ea2a06271ac537761430bad3059a
Log: Fixed bug #64677 (execution operator `` stealing surrounding arguments)
 [2013-04-20 07:24 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6ed16753c146ea2a06271ac537761430bad3059a
Log: Fixed bug #64677 (execution operator `` stealing surrounding arguments)
 [2013-11-17 09:31 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6ed16753c146ea2a06271ac537761430bad3059a
Log: Fixed bug #64677 (execution operator `` stealing surrounding arguments)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC