Skip to content

Commit

Permalink
test: temporary fix for UNC path parsing issue (alexcrichton#331)
Browse files Browse the repository at this point in the history
Prepend `c:` so that it won't be treated as UNC path.

See rust-lang/rust#100833 for more.
  • Loading branch information
weihanglo authored Jul 5, 2023
1 parent f4f439c commit 7025986
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,21 @@ fn extracting_malicious_tarball() {
t!(a.append(&header, io::repeat(1).take(1)));
};
append("/tmp/abs_evil.txt");
append("//tmp/abs_evil2.txt");
// std parse `//` as UNC path, see rust-lang/rust#100833
append(
#[cfg(not(windows))]
"//tmp/abs_evil2.txt",
#[cfg(windows)]
"C://tmp/abs_evil2.txt",
);
append("///tmp/abs_evil3.txt");
append("/./tmp/abs_evil4.txt");
append("//./tmp/abs_evil5.txt");
append(
#[cfg(not(windows))]
"//./tmp/abs_evil5.txt",
#[cfg(windows)]
"C://./tmp/abs_evil5.txt",
);
append("///./tmp/abs_evil6.txt");
append("/../tmp/rel_evil.txt");
append("../rel_evil2.txt");
Expand Down

0 comments on commit 7025986

Please sign in to comment.