CID
1274295 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression
usec * 1000 with type int (32 bits, signed) is evaluated using
32-bit arithmetic before being used in a context which expects
an expression of type uint64_t (64 bits, unsigned).
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
gmtime_r(&tt, &tm);
if (nsec) {
- *nsec = usec * 1000;
+ *nsec = (uint64_t)usec * 1000;
}
}
time_t t = timegm(&tm);