From: Antony Dovgal Date: Sat, 19 Mar 2005 13:56:31 +0000 (+0000) Subject: MFH: fix segfault in bzopen() X-Git-Tag: php-5.0.4RC2~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=811b268fb1c3ca5dab942c73f3bef0531ce0f763;p=php MFH: fix segfault in bzopen() --- diff --git a/NEWS b/NEWS index bdcd72cf59..274d86bd7f 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ PHP NEWS - Changed phpize not to require libtool. (Jani) - Updated bundled oniguruma library (used for multibyte regular expression) to 3.7.0. (Moriyoshi) +- Fixed bug #32373 (segfault in bzopen() if supplied path to non-existent + file). (Tony) - Updated bundled libmbfl library (used for multibyte functions). (Moriyoshi) Fixed bugs: . Bug #32063 (mb_convert_encoding ignores named entity 'alpha') diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index 38a5d13f0e..e5e0de51e0 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); } }