mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-13 15:59:23 +01:00
RiivolutionPatcher: Protect against three or more dots in path traversal.
This commit is contained in:
parent
22c6f2fe3b
commit
fe7f3a6f26
@ -98,6 +98,13 @@ FileDataLoaderHostFS::MakeAbsoluteFromRelative(std::string_view external_relativ
|
||||
result.pop_back();
|
||||
result.pop_back();
|
||||
}
|
||||
else if (std::all_of(element.begin(), element.end(), [](char c) { return c == '.'; }))
|
||||
{
|
||||
// This is a triple, quadruple, etc. dot.
|
||||
// Some file systems treat this as several 'up' path traversals, but Riivolution does not.
|
||||
// If someone tries this just error out, it wouldn't work sensibly in Riivolution anyway.
|
||||
return std::nullopt;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We're going down a level.
|
||||
|
Loading…
x
Reference in New Issue
Block a user