From 693c1f1e9281cefa52ce7a36b60b184b4cb41080 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Mon, 1 Sep 2025 19:40:16 +0100 Subject: [PATCH] Add null/empty parameter guard to FS_CreatePath --- code/qcommon/files.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/qcommon/files.c b/code/qcommon/files.c index c935f7cb..04d5f981 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -547,6 +547,10 @@ qboolean FS_CreatePath (const char *OSPath) { char *ofs; char path[MAX_OSPATH]; + if (!OSPath || !*OSPath) { + return qfalse; + } + // make absolutely sure that it can't back up the path // FIXME: is c: allowed??? if ( strstr( OSPath, ".." ) || strstr( OSPath, "::" ) ) {