Skip to content

Commit

Permalink
Path: Prevent Path::RealPath from returning '.' and '..' components
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoticgd authored and F0bes committed Dec 14, 2024
1 parent 68e6ede commit 0c21023
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 '.' and '..'
// components in the resultant path, which must be removed.
realpath = Path::Canonicalize(realpath);

#endif

return realpath;
Expand Down

0 comments on commit 0c21023

Please sign in to comment.