mirror of
https://github.com/systemd/systemd.git
synced 2026-08-13 17:08:14 +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 fore3017af973(cherry picked from commitaa2cc18c76)
This commit is contained in:
@@ -786,7 +786,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