1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 10:25:37 +03:00

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...
This commit is contained in:
Lennart Poettering 2015-11-03 12:27:12 +01:00
parent a0f29c767a
commit caffe412c7

View File

@ -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;
}