mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
C++: Test for IntMultToLong on char-typed numbers
This commit is contained in:
@@ -88,3 +88,7 @@ void use_printf(float f, double d)
|
||||
// ^ there's a float -> double varargs promotion here, but it's unlikely that the author anticipates requiring a double
|
||||
printf("%f", d * d); // safe
|
||||
}
|
||||
|
||||
size_t three_chars(unsigned char a, unsigned char b, unsigned char c) {
|
||||
return a * b * c; // at most 16581375 [FALSE POSITIVE]
|
||||
}
|
||||
|
||||
@@ -7,3 +7,4 @@
|
||||
| IntMultToLong.c:61:23:61:33 | ... * ... | Multiplication result may overflow 'int' before it is converted to 'long long'. |
|
||||
| IntMultToLong.c:63:23:63:40 | ... * ... | Multiplication result may overflow 'int' before it is converted to 'long long'. |
|
||||
| IntMultToLong.c:75:9:75:13 | ... * ... | Multiplication result may overflow 'int' before it is converted to 'size_t'. |
|
||||
| IntMultToLong.c:93:12:93:20 | ... * ... | Multiplication result may overflow 'int' before it is converted to 'size_t'. |
|
||||
|
||||
Reference in New Issue
Block a user