Add files via upload

This commit is contained in:
ihsinme
2021-04-25 22:35:40 +03:00
committed by GitHub
parent 50c63a88c3
commit 98f7f70814
3 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1 @@
| test.c:12:9:12:16 | intIndex | A variable with this name is used in the loop condition. |

View File

@@ -0,0 +1 @@
experimental/Security/CWE/CWE-1126/DeclarationOfVariableWithUnnecessarilyWideScope.ql

View File

@@ -0,0 +1,15 @@
void workFunction_0(char *s) {
int intIndex = 10;
char buf[80];
while(intIndex > 2) // GOOD
{
buf[intIndex] = 1;
intIndex--;
}
while(intIndex > 2)
{
buf[intIndex] = 1;
int intIndex; // BAD
intIndex--;
}
}