From 71d31330f993980ad0f3c0a687b48c5402ee130c Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 5 Apr 2025 14:03:24 +0500 Subject: [PATCH] filesystem: dir: fix possible null dereference --- filesystem/dir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/filesystem/dir.c b/filesystem/dir.c index cd012c8a..68ae040c 100644 --- a/filesystem/dir.c +++ b/filesystem/dir.c @@ -471,6 +471,9 @@ static file_t *FS_OpenFile_DIR( searchpath_t *search, const char *filename, cons Q_snprintf( path, sizeof( path ), "%s%s", search->filename, filename ); f = FS_SysOpen( path, mode ); + if( !f ) + return NULL; + f->searchpath = search; return f;