Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1a5282a

Browse files
committed
C++: Add testcase that previously resulted in a false positive
1 parent 525a000 commit 1a5282a

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

  • cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/wider_type

cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/wider_type/test.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,10 @@ void test10(int x) {
6969
} while (0);
7070
}
7171
}
72+
73+
extern const int const256;
74+
75+
void test11() {
76+
short s;
77+
for(s = 0; s < const256; ++s) {}
78+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const int const256 = 256;

0 commit comments

Comments
 (0)