mirror of
https://github.com/systemd/systemd.git
synced 2026-08-04 15:10:33 +00:00
sd-bus: use usec_add() for auth timeout calculation
Use the overflow-safe usec_add() instead of raw addition for
computing the authentication timeout.
CID#1548036
Follow-up for e3017af973
This commit is contained in:
@@ -788,7 +788,7 @@ int bus_socket_start_auth(sd_bus *b) {
|
||||
bus_get_peercred(b);
|
||||
|
||||
bus_set_state(b, BUS_AUTHENTICATING);
|
||||
b->auth_timeout = now(CLOCK_MONOTONIC) + BUS_AUTH_TIMEOUT;
|
||||
b->auth_timeout = usec_add(now(CLOCK_MONOTONIC), BUS_AUTH_TIMEOUT);
|
||||
|
||||
if (sd_is_socket(b->input_fd, AF_UNIX, 0, 0) <= 0)
|
||||
b->accept_fd = false;
|
||||
|
||||
Reference in New Issue
Block a user