We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21f4325 commit bb97507Copy full SHA for bb97507
1 file changed
cpp/ql/test/experimental/query-tests/Security/CWE/CWE-1126/semmle/tests/test.c
@@ -6,10 +6,27 @@ void workFunction_0(char *s) {
6
buf[intIndex] = 1;
7
intIndex--;
8
}
9
+ intIndex = 10;
10
while(intIndex > 2)
11
{
12
13
int intIndex; // BAD
14
15
16
17
+ while(intIndex > 2) // GOOD
18
+ {
19
+ buf[intIndex] = 1;
20
+ intIndex -= 2;
21
+ int intIndex;
22
+ intIndex--;
23
+ }
24
25
26
27
28
+ --intIndex;
29
30
31
32
0 commit comments