mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 04:08:55 +00:00
RiivolutionPatcher: Protect against three or more dots in path traversal.
This commit is contained in:
parent
22c6f2fe3b
commit
fe7f3a6f26
1 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue