diff options
author | Stijn Tintel <stijn@linux-ipv6.be> | 2021-11-04 02:17:39 +0300 |
---|---|---|
committer | Stijn Tintel <stijn@linux-ipv6.be> | 2021-11-04 02:45:46 +0300 |
commit | be3dc7223a6d75587e26f8b8d6d56920841e44b6 (patch) | |
tree | 4db949da1219c99c7375519257945db3b51907f1 /uloop.h | |
parent | d716ac4bc4236031d4c3cc1ed362b502e20e3787 (diff) |
uloop: avoid integer overflow in tv_diff
The tv_diff function can potentially overflow as soon as t2->tv_sec is
larger than 2147483. This is very easily hit in ujail, after only
2147484 seconds of uptime, or 24.85 days.
Improve the behaviour by changing the return type to int64_t.
Fixes: FS#3943
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Diffstat (limited to 'uloop.h')
-rw-r--r-- | uloop.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -92,7 +92,7 @@ int uloop_fd_delete(struct uloop_fd *sock); int uloop_timeout_add(struct uloop_timeout *timeout); int uloop_timeout_set(struct uloop_timeout *timeout, int msecs); int uloop_timeout_cancel(struct uloop_timeout *timeout); -int uloop_timeout_remaining(struct uloop_timeout *timeout); +int64_t uloop_timeout_remaining(struct uloop_timeout *timeout); int uloop_process_add(struct uloop_process *p); int uloop_process_delete(struct uloop_process *p); |