From d5381e701fc4f5e67b28bff9646b077f5d4fd050 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 7 Oct 2018 05:20:28 +0000 Subject: [PATCH] Fix potential null pointer dereferencing git-svn-id: https://svn.eduke32.com/eduke32@7004 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 5c7d7b8c5..698e7b54d 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -6504,7 +6504,7 @@ int app_main(int argc, char const * const * argv) char *const setupFileName = Xstrdup(g_setupFileName); char *const p = strtok(setupFileName, "."); - if (!Bstrcmp(g_setupFileName, SETUPFILENAME)) + if (!p || !Bstrcmp(g_setupFileName, SETUPFILENAME)) Bsprintf(tempbuf, "settings.cfg"); else Bsprintf(tempbuf, "%s_settings.cfg", p);