Skip to content

Commit 98f7f70

Browse files
authored
Add files via upload
1 parent 50c63a8 commit 98f7f70

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| test.c:12:9:12:16 | intIndex | A variable with this name is used in the loop condition. |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
experimental/Security/CWE/CWE-1126/DeclarationOfVariableWithUnnecessarilyWideScope.ql
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
void workFunction_0(char *s) {
2+
int intIndex = 10;
3+
char buf[80];
4+
while(intIndex > 2) // GOOD
5+
{
6+
buf[intIndex] = 1;
7+
intIndex--;
8+
}
9+
while(intIndex > 2)
10+
{
11+
buf[intIndex] = 1;
12+
int intIndex; // BAD
13+
intIndex--;
14+
}
15+
}

0 commit comments

Comments
 (0)