Skip to content

Commit 61bce89

Browse files
committed
Java: ArithmeticUncontrolled
1 parent 21e04a3 commit 61bce89

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

java/ql/lib/semmle/code/java/security/ArithmeticUncontrolledQuery.qll

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@ module ArithmeticUncontrolledOverflowConfig implements DataFlow::ConfigSig {
2121
predicate isBarrier(DataFlow::Node n) { overflowBarrier(n) }
2222

2323
predicate observeDiffInformedIncrementalMode() {
24-
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 29 (/Users/d10c/src/semmle-code/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql@36:8:36:10), Column 5 does not select a source or sink originating from the flow call on line 29 (/Users/d10c/src/semmle-code/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql@38:3:38:18)
25-
}
26-
27-
Location getASelectedSourceLocation(DataFlow::Node source) {
28-
none() // TODO: Make sure that this source location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 29 (/Users/d10c/src/semmle-code/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql@36:8:36:10), Column 5 does not select a source or sink originating from the flow call on line 29 (/Users/d10c/src/semmle-code/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql@38:3:38:18)
24+
any() // merged with ArithmeticUncontrolledUnderflow in ArithmeticUncontrolled.ql
2925
}
3026

3127
Location getASelectedSinkLocation(DataFlow::Node sink) {
32-
none() // TODO: Make sure that this sink location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 29 (/Users/d10c/src/semmle-code/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql@36:8:36:10), Column 5 does not select a source or sink originating from the flow call on line 29 (/Users/d10c/src/semmle-code/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql@38:3:38:18)
28+
exists(ArithExpr exp | result = exp.getLocation() | overflowSink(exp, sink.asExpr()))
3329
}
3430
}
3531

@@ -46,15 +42,11 @@ module ArithmeticUncontrolledUnderflowConfig implements DataFlow::ConfigSig {
4642
predicate isBarrier(DataFlow::Node n) { underflowBarrier(n) }
4743

4844
predicate observeDiffInformedIncrementalMode() {
49-
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 33 (/Users/d10c/src/semmle-code/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql@36:8:36:10), Column 5 does not select a source or sink originating from the flow call on line 33 (/Users/d10c/src/semmle-code/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql@38:3:38:18)
50-
}
51-
52-
Location getASelectedSourceLocation(DataFlow::Node source) {
53-
none() // TODO: Make sure that this source location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 33 (/Users/d10c/src/semmle-code/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql@36:8:36:10), Column 5 does not select a source or sink originating from the flow call on line 33 (/Users/d10c/src/semmle-code/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql@38:3:38:18)
45+
any() // merged with ArithmeticUncontrolledOverflow in ArithmeticUncontrolled.ql
5446
}
5547

5648
Location getASelectedSinkLocation(DataFlow::Node sink) {
57-
none() // TODO: Make sure that this sink location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 33 (/Users/d10c/src/semmle-code/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql@36:8:36:10), Column 5 does not select a source or sink originating from the flow call on line 33 (/Users/d10c/src/semmle-code/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql@38:3:38:18)
49+
exists(ArithExpr exp | result = exp.getLocation() | underflowSink(exp, sink.asExpr()))
5850
}
5951
}
6052

0 commit comments

Comments
 (0)