#19313 [NEW]: PHP causes Apache crash if command in passthru(command, outputresult) is blank

From: Date: Mon, 09 Sep 2002 12:35:26 +0000
Subject: #19313 [NEW]: PHP causes Apache crash if command in passthru(command, outputresult) is blank
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18771@lists.php.net to get a copy of this message
From: richard@oblius.com Operating system: Windows 2000 Professional PHP version: 4.2.3 PHP Bug Type: Reproducible crash Bug description: PHP causes Apache crash if command in passthru(command, outputresult) is blank 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. -- Edit bug report at http://bugs.php.net/?id=19313&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19313&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19313&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19313&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19313&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19313&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19313&r=support Expected behavior: http://bugs.php.net/fix.php?id=19313&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19313&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19313&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19313&r=globals

« previous php.bugs (#18771) next »