Skip to content

Commit

Permalink
add directory check
Browse files Browse the repository at this point in the history
- new path can lead into a folder inside update that's named exactly as the game's file, which will crash
  • Loading branch information
ThirteenAG committed Jan 20, 2024
1 parent f234a76 commit b22101f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ std::filesystem::path WINAPI GetOverloadedFilePath(std::filesystem::path lpFilen
if (starts_with(std::filesystem::path(absolutePath).remove_filename(), gamePath) || starts_with(std::filesystem::path(absolutePath).remove_filename(), commonPath))
{
auto newPath = gamePath / sFileLoaderPath.make_preferred() / relativePath;
if (std::filesystem::exists(newPath, ec))
if (std::filesystem::exists(newPath, ec) && !std::filesystem::is_directory(newPath, ec))
return newPath;
}
}
Expand Down

0 comments on commit b22101f

Please sign in to comment.