|
Background
There are several examples of casts between integral types of mismatched sizes.
Here is an example:
kms->msg.len = (uint32_t) strlen (request_string);
|
This casts the size_t returned by strlen into a uint32_t. The size of size_t is platform dependent.
Scope
- Check for all cases of integer conversions that may result in narrowing or undefined behavior.
- Return an error when possible in cases where the cast would result in unexpected overflow.
- Investigate whether narrowing conversions can cause an error in Evergreen builds to prevent future regressions.
|