Skip to content

Commit db49d95

Browse files
committed
Filter out tests directories
1 parent 720285f commit db49d95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/ql/src/Security/CWE/CWE-129/ImproperArrayIndexValidation.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ predicate predictableInstruction(Instruction instr) {
6868
module ImproperArrayIndexValidationConfig implements DataFlow::ConfigSig {
6969
predicate isSource(DataFlow::Node source) {
7070
isFlowSource(source, _) and
71-
not source.asExpr().getFile().getRelativePath().regexpMatch("/tests?/")
71+
not source.getLocation().getFile().getRelativePath().regexpMatch("(.*/)?tests?/.*")
7272
}
7373

7474
predicate isBarrier(DataFlow::Node node) {

0 commit comments

Comments
 (0)