From: Antony Dovgal Date: Sat, 19 Mar 2005 13:56:00 +0000 (+0000) Subject: fix #32373 (segfault in bzopen('/wrong/path')) X-Git-Tag: php-5.0.1b1~749 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f27fb2d715bad83a5d0bb349c636f062320ad789;p=php fix #32373 (segfault in bzopen('/wrong/path')) --- diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index 4718220205..7b5ab44e3a 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -196,7 +196,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, /* remove the file created by php_stream_open_wrapper(), it is not needed since BZ2 functions * failed. */ - if (!bz_file && mode[0] == 'w') { + if (opened_path && !bz_file && mode[0] == 'w') { VCWD_UNLINK(*opened_path); } }