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:
5e42721
)
sd-daemon: explicitly filter out -1 when parsing watchdog timeout
author
Lennart Poettering
<lennart@poettering.net>
Tue, 3 Nov 2015 11:27:12 +0000
(12:27 +0100)
committer
Sven Eden
<yamakuzure@gmx.net>
Wed, 26 Apr 2017 10:58:55 +0000
(12:58 +0200)
We already filter out 0, and as -1 is usually special (meaning infinity,
as in USEC_INFINITY) we should better not accept it either. Better safe
than sorry...
src/libelogind/sd-daemon/sd-daemon.c
patch
|
blob
|
history
diff --git
a/src/libelogind/sd-daemon/sd-daemon.c
b/src/libelogind/sd-daemon/sd-daemon.c
index 3ea9764c45bd383ec24d9272ed9e3b8b61b5db4f..e47da68a66f3cd6a0bcd82998292e15a14b6b8f2 100644
(file)
--- a/
src/libelogind/sd-daemon/sd-daemon.c
+++ b/
src/libelogind/sd-daemon/sd-daemon.c
@@
-595,7
+595,7
@@
_public_ int sd_watchdog_enabled(int unset_environment, uint64_t *usec) {
r = safe_atou64(s, &u);
if (r < 0)
goto finish;
- if (u <= 0) {
+ if (u <= 0
|| u >= USEC_INFINITY
) {
r = -EINVAL;
goto finish;
}