mirror of
https://github.com/revanced/Apktool.git
synced 2024-09-07 06:56:30 +02:00
test: ensure we don't allow path traversal with win
This commit is contained in:
parent
47854ec757
commit
4aa933b31a
@ -71,6 +71,18 @@ public class UnknownDirectoryTraversalTest extends BaseTest {
|
||||
BrutIO.sanitizeUnknownFile(sTmpDir, "");
|
||||
}
|
||||
|
||||
@Test(expected = TraversalUnknownFileException.class)
|
||||
public void invalidBackwardPathOnWindows() throws IOException, BrutException {
|
||||
String invalidPath;
|
||||
if (! OSDetection.isWindows()) {
|
||||
invalidPath = "../../app";
|
||||
} else {
|
||||
invalidPath = "..\\..\\app.exe";
|
||||
}
|
||||
|
||||
BrutIO.sanitizeUnknownFile(sTmpDir, invalidPath);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void validDirectoryFileTest() throws IOException, BrutException {
|
||||
String validFilename = BrutIO.sanitizeUnknownFile(sTmpDir, "dir" + File.separator + "file");
|
||||
|
Loading…
Reference in New Issue
Block a user