time-util: add overflow checking to monotonic timestamp specifications

This commit is contained in:
Lennart Poettering
2017-02-02 20:12:32 +01:00
parent 74c5b33b0a
commit 315782db14
+2
View File
@@ -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;