mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-04 18:12:54 +01: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, "");
|
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
|
@Test
|
||||||
public void validDirectoryFileTest() throws IOException, BrutException {
|
public void validDirectoryFileTest() throws IOException, BrutException {
|
||||||
String validFilename = BrutIO.sanitizeUnknownFile(sTmpDir, "dir" + File.separator + "file");
|
String validFilename = BrutIO.sanitizeUnknownFile(sTmpDir, "dir" + File.separator + "file");
|
||||||
|
Loading…
Reference in New Issue
Block a user