We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e21f47 commit 948f1d8Copy full SHA for 948f1d8
cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/test5.cpp
@@ -29,4 +29,14 @@ void useTaintedIntWithGuard() {
29
if(imaxabs(tainted) <= 100) {
30
int product = tainted * tainted; // GOOD: can't underflow/overflow
31
}
32
+}
33
+
34
+#define INTMAX_MIN (-0x7fffffffffffffff - 1)
35
36
+void useTaintedIntWithGuardIntMaxMin() {
37
+ intmax_t tainted = getTaintedInt();
38
39
+ if(imaxabs(tainted) <= INTMAX_MIN) {
40
+ int product = tainted * tainted; // BAD: imaxabs(INTMAX_MIN) == INTMAX_MIN [NOT DETECTED]
41
+ }
42
0 commit comments