You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FilePath::resolved() goes wrong when you have multiple concatenated path separators, combined with path traversal paths.
a/b//../c should be resolved to a/c. cppfs instead resolves it to a/b/c
Windows 10 and Ubuntu 20.04 both treat concatenated path separators as "one" path separator. a/b//c////../../d is treated as a/b/c/../../d and thus is resolved to a/d.
Here is a small program to illustrate the behaviour:
FilePath::resolved()
goes wrong when you have multiple concatenated path separators, combined with path traversal paths.a/b//../c
should be resolved toa/c
. cppfs instead resolves it toa/b/c
Windows 10 and Ubuntu 20.04 both treat concatenated path separators as "one" path separator.
a/b//c////../../d
is treated asa/b/c/../../d
and thus is resolved toa/d
.Here is a small program to illustrate the behaviour:
Building the program against the current cppfs master results in the following output:
I then gave all of the paths to
file
:As seen, the last path (p3 resolved by cppfs) results in a "file not found" when it should not.
The text was updated successfully, but these errors were encountered: