chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f082899
)
time-util: add overflow checking to monotonic timestamp specifications
author
Lennart Poettering
<lennart@poettering.net>
Thu, 2 Feb 2017 17:35:00 +0000
(18:35 +0100)
committer
Sven Eden
<yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:36 +0000
(17:58 +0200)
src/basic/time-util.c
patch
|
blob
|
history
diff --git
a/src/basic/time-util.c
b/src/basic/time-util.c
index 265f5995a2e1b21e145c71a424f8ddb2a284a9c0..6a76b655120d9bd73672e1ba095176dcec4553b0 100644
(file)
--- a/
src/basic/time-util.c
+++ b/
src/basic/time-util.c
@@
-857,6
+857,8
@@
from_tm:
return -EINVAL;
finish:
+ if (ret + plus < ret) /* overflow? */
+ return -EINVAL;
ret += plus;
if (ret > USEC_TIMESTAMP_FORMATTABLE_MAX)
return -EINVAL;