mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
Merge pull request #58 from microsoft/jb1/improper-array-index
Jb1/improper array index
This commit is contained in:
@@ -66,7 +66,10 @@ predicate predictableInstruction(Instruction instr) {
|
||||
}
|
||||
|
||||
module ImproperArrayIndexValidationConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) { isFlowSource(source, _) }
|
||||
predicate isSource(DataFlow::Node source) {
|
||||
isFlowSource(source, _) and
|
||||
not source.getLocation().getFile().getRelativePath().regexpMatch("(.*/)?tests?/.*")
|
||||
}
|
||||
|
||||
predicate isBarrier(DataFlow::Node node) {
|
||||
hasUpperBound(node.asExpr())
|
||||
@@ -117,7 +120,8 @@ module ImproperArrayIndexValidationConfig implements DataFlow::ConfigSig {
|
||||
module ImproperArrayIndexValidation = TaintTracking::Global<ImproperArrayIndexValidationConfig>;
|
||||
|
||||
from
|
||||
ImproperArrayIndexValidation::PathNode source, ImproperArrayIndexValidation::PathNode sink,
|
||||
ImproperArrayIndexValidation::PathNode source,
|
||||
ImproperArrayIndexValidation::PathNode sink,
|
||||
string sourceType
|
||||
where
|
||||
ImproperArrayIndexValidation::flowPath(source, sink) and
|
||||
|
||||
Reference in New Issue
Block a user