time-util: add overflow checking to monotonic timestamp specifications
This commit is contained in:
@@ -844,6 +844,8 @@ from_tm:
|
||||
return -EINVAL;
|
||||
|
||||
finish:
|
||||
if (ret + plus < ret) /* overflow? */
|
||||
return -EINVAL;
|
||||
ret += plus;
|
||||
if (ret > USEC_TIMESTAMP_FORMATTABLE_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user