Use explict casts.
This was reported in
@@ -2795,10 +2795,10 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset,
if ((uint32_t)diff.tv_sec > UINT32_MAX / 1000000) {
staleness = UINT32_MAX;
} else {
- staleness = diff.tv_sec * 1000000;
+ staleness = (uint32_t)diff.tv_sec * 1000000;
}
if (UINT32_MAX - staleness >= (uint32_t)diff.tv_usec) {
- staleness += diff.tv_usec;
+ staleness += (uint32_t)diff.tv_usec;
} else {
staleness = UINT32_MAX;
}
