1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-28 03:25:27 +03:00

time-util: add overflow checking to monotonic timestamp specifications

This commit is contained in:
Lennart Poettering 2017-02-02 18:35:00 +01:00
parent 74c5b33b0a
commit 315782db14

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;