From 68472f90ebb1cd6097e0ac87e6caf19412b54c32 Mon Sep 17 00:00:00 2001 From: mittorn Date: Fri, 14 Feb 2020 21:48:26 +0700 Subject: [PATCH] filesystem: disable XASH_REDUCE_FD where it not needed, fix null pointer deference --- engine/common/filesystem.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/engine/common/filesystem.c b/engine/common/filesystem.c index 5140c47d..bfb793ba 100644 --- a/engine/common/filesystem.c +++ b/engine/common/filesystem.c @@ -64,8 +64,6 @@ GNU General Public License for more details. #define ZIP_LOAD_NO_FILES 5 #define ZIP_LOAD_CORRUPTED 6 -#define XASH_REDUCE_FD - typedef struct stringlist_s { // maxstrings changes as needed, causing reallocation of strings[] array @@ -168,7 +166,7 @@ static void FS_EnsureOpenFile( file_t *file ) if( fs_last_readfile == file ) return; - if( !file->backup_path ) + if( file && !file->backup_path ) return; if( fs_last_readfile && (fs_last_readfile->handle != -1) )