mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +01:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
| test.cpp:10:3:10:10 | ... = ... | this expression needs attention |
|
||||
| test.cpp:12:3:12:6 | ... ++ | this expression needs attention |
|
||||
| test.cpp:13:3:13:6 | ++ ... | this expression needs attention |
|
||||
| test.cpp:14:6:14:21 | ... = ... | this expression needs attention |
|
||||
| test.cpp:16:6:16:21 | ... = ... | this expression needs attention |
|
||||
@@ -0,0 +1 @@
|
||||
experimental/Security/CWE/CWE-783/OperatorPrecedenceLogicErrorWhenUseBoolType.ql
|
||||
@@ -0,0 +1,26 @@
|
||||
int tmpFunc()
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
void testFunction()
|
||||
{
|
||||
int i1,i2,i3;
|
||||
bool b1,b2,b3;
|
||||
char c1,c2,c3;
|
||||
b1 = -b2; //BAD
|
||||
b1 = !b2; //GOOD
|
||||
b1++; //BAD
|
||||
++b1; //BAD
|
||||
if(i1=tmpFunc()!=i2) //BAD
|
||||
return;
|
||||
if(i1=tmpFunc()!=11) //BAD
|
||||
return;
|
||||
if((i1=tmpFunc())!=i2) //GOOD
|
||||
return;
|
||||
if((i1=tmpFunc())!=11) //GOOD
|
||||
return;
|
||||
if(i1=tmpFunc()!=1) //GOOD
|
||||
return;
|
||||
if(i1=tmpFunc()==b1) //GOOD
|
||||
return;
|
||||
}
|
||||
Reference in New Issue
Block a user