mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Update java/ql/src/Security/CWE/CWE-023/PartialPathTraversalBad.java
Co-authored-by: Jonathan Leitschuh <jonathan.leitschuh@gmail.com>
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user