Skip to content

Commit

Permalink
Fix crash when following symlinks to nonexistent IWAD files
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 authored and coelckers committed Feb 12, 2021
1 parent 6bc82bd commit 0a30c19
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/d_iwad.cpp
Expand Up @@ -577,6 +577,12 @@ int FIWadManager::IdentifyVersion (TArray<FString> &wadfiles, const char *iwad,
// -iwad not found or not specified. Revert back to standard behavior.
if (mFoundWads.Size() == numFoundWads) iwadparm = nullptr;

// Check for symbolic links leading to non-existent files.
for (unsigned int i = 0; i < mFoundWads.Size(); i++)
{
if (!FileExists(mFoundWads[i].mFullPath)) mFoundWads.Delete(i);
}

// Now check if what got collected actually is an IWAD.
ValidateIWADs();

Expand Down

0 comments on commit 0a30c19

Please sign in to comment.