Skip to content

Commit

Permalink
Fix nullptr dereference in front of nullptr check in FS_CheckPak0
Browse files Browse the repository at this point in the history
Found using LLVM sanitizer. Reported by Dominic "lonkamikaze" Fandrey
and David "devnexen" CARLIER.
  • Loading branch information
zturtleman committed Apr 9, 2018
1 parent 9f294ce commit 4ea0eeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/qcommon/files.c
Expand Up @@ -3458,17 +3458,17 @@ static void FS_CheckPak0( void )
{
searchpath_t *path;
pack_t *curpack;
const char *pakBasename;
qboolean founddemo = qfalse;
unsigned int foundPak = 0, foundTA = 0;

for( path = fs_searchpaths; path; path = path->next )
{
const char* pakBasename = path->pack->pakBasename;

if(!path->pack)
continue;

curpack = path->pack;
pakBasename = curpack->pakBasename;

if(!Q_stricmpn( curpack->pakGamename, "demoq3", MAX_OSPATH )
&& !Q_stricmpn( pakBasename, "pak0", MAX_OSPATH ))
Expand Down

0 comments on commit 4ea0eeb

Please sign in to comment.