php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19313 PHP causes Apache crash if command in passthru(command, outputresult) is blank
Submitted: 2002-09-09 07:35 UTC Modified: 2002-09-19 14:03 UTC
From: richard at oblius dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.2.3 OS: Windows 2000 Professional
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: richard at oblius dot com
New email:
PHP Version: OS:

 

 [2002-09-09 07:35 UTC] richard at oblius dot com
SUMMARY:
When using the passthru(command, outputresult) function, and passing 'command' an uninitialized variable, Apache for Win32 will crash, and restart.

HOW IT HAPPENED:
During development of an image gallery, I was using passthru() to run ImageMagick Mogrify.exe to scale thumbnails.  I was using the variable $mogcommand to keep the shell command to use in passthru(), and $outputresult to store the result. I made a typo in $mogcommand ($mogcomand), and when testing the page in my browser, Apache for Win32 crashed, and restarted.  The $mogcomand variable was not initialized or previously used.

REPRODUCIBLE?
Yes.  Anytime I pass an unitialized variable to the shell command parameter of passthru(), the Apache server will crash and restart.

STABILITY / INSTALLATION QUALITY?
So far, perfect.  Any problems other than this have been a result of my own misconfiguration.  I have used passthru() many times on this server with no problems, provided I pass a valid variable to it.  I believe this is a valid bug.

ENVIRONMENT TYPE:
Development/testing server

SOFTWARE ENVIRONMENT:
Windows 2000 Professional
Apache 1.3.26 for Win32
PHP 4.2.3 for Win32 (MODULE)

HARDWARE ENVIRONMENT:
Pentium II/400 Mhz
128MB PC-100 SDRAM
8GB Maxtor ATA-66 Hard Drive

POSSIBLE SOLUTION:
Check if the variable passed to the shell command parameter of passthru() is initialized, and if not, generate the appropriate warning/error message.






Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-19 14:03 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Mar 17 07:00:02 2026 UTC