mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
C++: Fixed handling of false negative. Query now supports global variables
This commit is contained in:
@@ -117,4 +117,12 @@ void g2(struct A* a, short n) {
|
||||
unsigned long ulong1, ulong2;
|
||||
ulong1 = (a->s - 1) * ((*a).s + 1); // GOOD
|
||||
ulong2 = a->i * (*a).i; // BAD
|
||||
}
|
||||
|
||||
int global_i;
|
||||
unsigned char global_uchar;
|
||||
void g3() {
|
||||
unsigned long ulong1, ulong2;
|
||||
ulong1 = global_i * global_i; // BAD
|
||||
ulong2 = (global_uchar + 1) * 2; // GOOD
|
||||
}
|
||||
@@ -11,3 +11,4 @@
|
||||
| IntMultToLong.c:103:14:103:46 | ... * ... | Multiplication result may overflow 'int' before it is converted to 'unsigned long'. |
|
||||
| IntMultToLong.c:108:14:108:78 | ... * ... | Multiplication result may overflow 'int' before it is converted to 'unsigned long'. |
|
||||
| IntMultToLong.c:119:14:119:26 | ... * ... | Multiplication result may overflow 'int' before it is converted to 'unsigned long'. |
|
||||
| IntMultToLong.c:126:14:126:32 | ... * ... | Multiplication result may overflow 'int' before it is converted to 'unsigned long'. |
|
||||
|
||||
Reference in New Issue
Block a user