mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Update java/ql/src/Security/CWE/CWE-023/PartialPathTraversalGood.java
Co-authored-by: Jonathan Leitschuh <jonathan.leitschuh@gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import java.io.File;
|
||||
|
||||
public class PartialPathTraversalGood {
|
||||
public void esapiExample(File dir, File parent) throws IOException {
|
||||
public void example(File dir, File parent) throws IOException {
|
||||
if (!dir.getCanonicalPath().startsWith(parent.getCanonicalPath().toPath())) {
|
||||
throw new IOException("Invalid directory: " + dir.getCanonicalPath());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user