varlink: add an extra assert encoding our assumption that ucred is valid here

This commit is contained in:
Lennart Poettering 2023-11-23 18:23:40 +01:00
parent c931c871aa
commit a13518231a

View file

@ -3018,6 +3018,8 @@ static int count_connection(VarlinkServer *server, const struct ucred *ucred) {
server->n_connections++;
if (FLAGS_SET(server->flags, VARLINK_SERVER_ACCOUNT_UID)) {
assert(uid_is_valid(ucred->uid));
r = hashmap_ensure_allocated(&server->by_uid, NULL);
if (r < 0)
return varlink_server_log_errno(server, r, "Failed to allocate UID hash table: %m");