#23981 [NEW]: bcompiler doesn't check the return value of php_stream_open_wrapper()

From: Date: Tue, 03 Jun 2003 11:35:42 +0000
Subject: #23981 [NEW]: bcompiler doesn't check the return value of php_stream_open_wrapper()
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16932@lists.php.net to get a copy of this message
From: per at nobolt dot com Operating system: Debian GNU/Linux PHP version: 4.3.2 PHP Bug Type: PEAR related Bug description: bcompiler doesn't check the return value of php_stream_open_wrapper() In the bz2_aware_stream_open(), there is code like this: BCOMPILER_DEBUG(("no bz2 support - opening it..\n")); stream = php_stream_open_wrapper(file_name, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL); /* Sanity check to see if it is a bzip2 encoded stream */ php_stream_read(stream, magic, sizeof(magic)); If the call to php_stream_open_wrapper() fails (which it will if the file does not exist), stream will be NULL and this will cause a segmentation fault in php_stream_read(). This can easily be fixed by just checking the return value; if it is NULL, return from the function immediately. -- Edit bug report at http://bugs.php.net/?id=23981&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23981&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23981&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23981&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23981&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23981&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23981&r=support Expected behavior: http://bugs.php.net/fix.php?id=23981&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23981&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23981&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23981&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23981&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23981&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23981&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23981&r=gnused

« previous php.pear.dev (#16932) next »