Skip to content

Commit

Permalink
Path: Make sure Path::RealPath returns paths with no '..' components
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoticgd committed Dec 9, 2024
1 parent c599d7f commit 46332aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,11 @@ std::string Path::RealPath(const std::string_view path)
}
}
}

// If any relative symlinks were resolved, there may be '..' components in
// the resultant path, which must be removed.
realpath = Path::Canonicalize(realpath);

#endif

return realpath;
Expand Down

0 comments on commit 46332aa

Please sign in to comment.