mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-23 12:32:09 +00:00
Fix nullptr dereference in front of nullptr check in FS_CheckPak0
Found using LLVM sanitizer. Reported by Dominic "lonkamikaze" Fandrey and David "devnexen" CARLIER.
This commit is contained in:
parent
9f294ce520
commit
4ea0eebfe5
1 changed files with 2 additions and 2 deletions
|
@ -3458,17 +3458,17 @@ static void FS_CheckPak0( void )
|
||||||
{
|
{
|
||||||
searchpath_t *path;
|
searchpath_t *path;
|
||||||
pack_t *curpack;
|
pack_t *curpack;
|
||||||
|
const char *pakBasename;
|
||||||
qboolean founddemo = qfalse;
|
qboolean founddemo = qfalse;
|
||||||
unsigned int foundPak = 0, foundTA = 0;
|
unsigned int foundPak = 0, foundTA = 0;
|
||||||
|
|
||||||
for( path = fs_searchpaths; path; path = path->next )
|
for( path = fs_searchpaths; path; path = path->next )
|
||||||
{
|
{
|
||||||
const char* pakBasename = path->pack->pakBasename;
|
|
||||||
|
|
||||||
if(!path->pack)
|
if(!path->pack)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
curpack = path->pack;
|
curpack = path->pack;
|
||||||
|
pakBasename = curpack->pakBasename;
|
||||||
|
|
||||||
if(!Q_stricmpn( curpack->pakGamename, "demoq3", MAX_OSPATH )
|
if(!Q_stricmpn( curpack->pakGamename, "demoq3", MAX_OSPATH )
|
||||||
&& !Q_stricmpn( pakBasename, "pak0", MAX_OSPATH ))
|
&& !Q_stricmpn( pakBasename, "pak0", MAX_OSPATH ))
|
||||||
|
|
Loading…
Reference in a new issue