summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-02-02 18:35:00 +0100
committerLennart Poettering <lennart@poettering.net>2017-02-02 20:12:32 +0100
commit315782db1423021c57d0dacecc48e5d15359c1cf (patch)
tree0a63d13bd27a7c8553c043a4769b655213b19fe3 /src/basic
parent74c5b33b0aaed6aae67e858926f5b1558e05b148 (diff)
time-util: add overflow checking to monotonic timestamp specifications
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/time-util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/basic/time-util.c b/src/basic/time-util.c
index fd86f1d449..4ced1bc6a1 100644
--- a/src/basic/time-util.c
+++ b/src/basic/time-util.c
@@ -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;