Skip to content

Commit cbf158e

Browse files
committed
Add files via upload
1 parent 36de496 commit cbf158e

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
| test.c:15:6:15:16 | ... + ... | this expression needs your attention |
2+
| test.c:17:17:17:27 | ... + ... | this expression needs your attention |
3+
| test.c:22:10:22:15 | ... > ... | this expression needs your attention |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
experimental/Security/CWE/CWE-691/InsufficientControlFlowManagementAfterRefactoringTheCode.ql
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
int tmpFunction(){
2+
return 5;
3+
}
4+
void workFunction_0(char *s) {
5+
int intSize;
6+
char buf[80];
7+
if(intSize>0 && intSize<80 && memset(buf,0,intSize)) return; // GOOD
8+
if(intSize>0 & intSize<80 & memset(buf,0,intSize)) return; // BAD
9+
if(intSize>0 && tmpFunction()) return;
10+
if(intSize<0 & tmpFunction()) return; // BAD
11+
}
12+
void workFunction_1(char *s) {
13+
int intA,intB;
14+
15+
if(intA + intB) return; // BAD
16+
if(intA + intB>4) return; // GOOD
17+
if(intA>0 && (intA + intB)) return; // BAD
18+
while(intA>0)
19+
{
20+
if(intB - intA<10) break;
21+
intA--;
22+
}while(intA>0); // BAD
23+
while(intA>0)
24+
{
25+
if(intB - intA<10) break;
26+
intA--;
27+
} // GOOD
28+
}

0 commit comments

Comments
 (0)