We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a2b5fbf commit 2de0e22Copy full SHA for 2de0e22
1 file changed
cpp/ql/test/experimental/query-tests/Security/CWE/CWE-190/IfStatementAdditionOverflow/test.cpp
@@ -52,6 +52,7 @@ void test()
52
if (c<=b+a) { a = c-b; } // BAD
53
54
if (a+b>d) a = d-b; // BAD
55
+ if (a+(double)b>c) a = c-b; // GOOD
56
if (a+(-x)>c) a = c-(-y); // GOOD
57
if (a+b>c) { b++; a = c-b; } // GOOD
58
if (a+d>c) a = c-d; // GOOD
0 commit comments