Skip to content

Commit 187299f

Browse files
authored
Update test.cpp
1 parent ef57861 commit 187299f

File tree

1 file changed

+3
-0
lines changed
  • cpp/ql/test/experimental/query-tests/Security/CWE/CWE-190/IfStatementAdditionOverflow

1 file changed

+3
-0
lines changed

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-190/IfStatementAdditionOverflow/test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,7 @@ void test()
5757
if (a+b>c) { b++; a = c-b; } // GOOD
5858
if (a+d>c) a = c-d; // GOOD
5959
if (a1+b1>c1) a1 = c1-b1; // GOOD
60+
61+
if (a+b<=c) { /* ... */ } else { a = c-b; } // BAD
62+
if (a+b<=c) { return; } a = c-b; // BAD
6063
}

0 commit comments

Comments
 (0)