Fix potential null pointer dereferencing

git-svn-id: https://svn.eduke32.com/eduke32@7004 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-10-07 05:20:28 +00:00
parent e449408b57
commit d5381e701f

View file

@ -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);