Skip to content

Commit b7ac03d

Browse files
Merge pull request #2 from geoffw0/assignadd2
CPP: Minor corrections to: Better overflow detection for AssignAdd/AssignSub
2 parents 63794c8 + 170691b commit b7ac03d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,5 +422,5 @@ void test17() {
422422
out(i); // 50
423423

424424
i = 20 + (j -= 10);
425-
out(i); // 60
425+
out(i); // 60 [BUG: the analysis thinks it's 2^-31 .. 2^31-1]
426426
}

cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/IntegerOverflowTainted.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
| test3.c:13:16:13:19 | * ... | $@ flows to here and is used in an expression which might overflow negatively. | test3.c:11:15:11:18 | argv | User-provided value |
33
| test4.cpp:13:17:13:20 | access to array | $@ flows to here and is used in an expression which might overflow negatively. | test4.cpp:9:13:9:16 | argv | User-provided value |
44
| test5.cpp:10:9:10:15 | call to strtoul | $@ flows to here and is used in an expression which might overflow. | test5.cpp:9:7:9:9 | buf | User-provided value |
5+
| test.c:44:7:44:12 | ... -- | $@ flows to here and is used in an expression which might overflow negatively. | test.c:41:17:41:20 | argv | User-provided value |
6+
| test.c:54:7:54:12 | ... -- | $@ flows to here and is used in an expression which might overflow negatively. | test.c:51:17:51:20 | argv | User-provided value |

0 commit comments

Comments
 (0)