mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
C++: Add FP test.
This commit is contained in:
@@ -3,3 +3,4 @@
|
||||
| test.cpp:204:7:204:11 | call to scanf | The result of scanf is only checked against 0, but it can also return EOF. |
|
||||
| test.cpp:436:7:436:11 | call to scanf | The result of scanf is only checked against 0, but it can also return EOF. |
|
||||
| test.cpp:443:11:443:15 | call to scanf | The result of scanf is only checked against 0, but it can also return EOF. |
|
||||
| test.cpp:467:8:467:12 | call to scanf | The result of scanf is only checked against 0, but it can also return EOF. |
|
||||
|
||||
@@ -458,4 +458,18 @@ void disjunct_boolean_condition(const char* modifier_data) {
|
||||
return;
|
||||
}
|
||||
use(value); // GOOD
|
||||
}
|
||||
|
||||
void check_for_negative_test() {
|
||||
int res;
|
||||
int value;
|
||||
|
||||
res = scanf("%d", &value); // GOOD [FALSE POSITIVE]
|
||||
if(res == 0) {
|
||||
return;
|
||||
}
|
||||
if (res < 0) {
|
||||
return;
|
||||
}
|
||||
use(value);
|
||||
}
|
||||
Reference in New Issue
Block a user