mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
tv_nsec can never be negative after timespecsub.
Found by PVS Studio
This commit is contained in:
@@ -787,7 +787,7 @@ sudo_ev_get_timeleft_v2(struct sudo_event *ev, struct timespec *ts)
|
||||
|
||||
sudo_gettime_mono(&now);
|
||||
sudo_timespecsub(&ev->timeout, &now, ts);
|
||||
if (ts->tv_sec < 0 || (ts->tv_sec == 0 && ts->tv_nsec < 0))
|
||||
if (ts->tv_sec < 0)
|
||||
sudo_timespecclear(ts);
|
||||
debug_return_int(0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user