Update java/ql/src/Security/CWE/CWE-023/PartialPathTraversalBad.java

Co-authored-by: Jonathan Leitschuh <jonathan.leitschuh@gmail.com>
This commit is contained in:
smehta23
2022-07-01 10:39:46 -04:00
committed by GitHub
parent 16814071df
commit c6f2f61bfb

View File

@@ -1,5 +1,5 @@
public class PartialPathTraversalBad {
public void esapiExample(File dir, File parent) throws IOException {
public void example(File dir, File parent) throws IOException {
if (!dir.getCanonicalPath().startsWith(parent.getCanonicalPath())) {
throw new IOException("Invalid directory: " + dir.getCanonicalPath());
}