|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-01-18 09:10 UTC] zhang_xiaobao at venustech dot com dot cn
Description:
------------
<?php
$wsh = new COM('WScript.shell');
$exec = $wsh->exec('cmd.exe /c whoami');
$stdout = $exec->StdOut();
$stroutput = $stdout->ReadAll();
echo $stroutput;
?>
Test script:
---------------
<?php
$wsh = new COM('WScript.shell');
$exec = $wsh->exec('cmd.exe /c whoami');
$stdout = $exec->StdOut();
$stroutput = $stdout->ReadAll();
echo $stroutput;
?>
Expected result:
----------------
1. First of all, add extension=php_com_dotnet.dll in php.ini.
2. when i load COM('WScript.shell') and call exec('cmd.exe /c whoami') to execute system command,the inside of the com waits for the process to exit,
as the same time,the com is freed by other modules,when the cmd.exe exited, the thread who suspend with the waitformultipleobjects function is activated.
but the eip is not invalid,because of the memory is free.
Actual result:
--------------
It cause the process of httpd.exe to crash.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 09:00:02 2025 UTC |
I am still having this issue on both php.exe and php-cgi.exe on Apache. Sample code: $test = new COM('WScript.Shell'); This causes PHP 7.2.9 x64 ZTS to crash. Any ideas?