diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-03 12:27:12 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-03 17:45:12 +0100 |
commit | caffe412c77a662f7b856109e588b03817acc36e (patch) | |
tree | 16eb7bc30429e4f917936d24e4752d6bcdf62134 /src/libsystemd/sd-daemon/sd-daemon.c | |
parent | a0f29c767a3bb3d621c658fa5b87063e1f44e24a (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/sd-daemon/sd-daemon.c')
-rw-r--r-- | src/libsystemd/sd-daemon/sd-daemon.c | 2 |
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; } |