summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-03 12:27:12 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-03 17:45:12 +0100
commitcaffe412c77a662f7b856109e588b03817acc36e (patch)
tree16eb7bc30429e4f917936d24e4752d6bcdf62134 /src/libsystemd
parenta0f29c767a3bb3d621c658fa5b87063e1f44e24a (diff)
sd-daemon: explicitly filter out -1 when parsing watchdog timeout
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...
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-daemon/sd-daemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c
index 27045e25d0..a48fa05908 100644
--- a/src/libsystemd/sd-daemon/sd-daemon.c
+++ b/src/libsystemd/sd-daemon/sd-daemon.c
@@ -586,7 +586,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;
}