]> granicus.if.org Git - php/commitdiff
MFH: fix segfault in bzopen()
authorAntony Dovgal <tony2001@php.net>
Sat, 19 Mar 2005 13:56:31 +0000 (13:56 +0000)
committerAntony Dovgal <tony2001@php.net>
Sat, 19 Mar 2005 13:56:31 +0000 (13:56 +0000)
NEWS
ext/bz2/bz2.c

diff --git a/NEWS b/NEWS
index bdcd72cf592eb5cd450ee4f6f0942a980db09caa..274d86bd7fd3eaa91e1faa715d118300f18a287b 100644 (file)
--- 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')
index 38a5d13f0ec851e1c1a168dfc9d82a0aa48ba813..e5e0de51e0f83b8a45c60ba9d7754b52eb54135f 100644 (file)
@@ -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);
                }
        }