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

index 471822020512fc94c622bae19eb675ede98055b3..7b5ab44e3a8dbb00e71518b7093b3f536223936c 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);
                }
        }