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:
Luca Boccassi
2026-03-28 21:37:47 +00:00
parent a05483a921
commit aa2cc18c76

View File

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