mirror of
https://github.com/systemd/systemd.git
synced 2025-02-09 13:57:42 +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:
parent
a0f29c767a
commit
caffe412c7
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user