Assorted coverity fixes (#41406)

This commit is contained in:
Daan De Meyer
2026-03-29 21:02:55 +02:00
committed by GitHub
16 changed files with 55 additions and 27 deletions
+4
View File
@@ -676,6 +676,8 @@ static int bus_socket_read_auth(sd_bus *b) {
return -ECONNRESET;
}
/* Silence static analyzers, k is bounded by iov size: n - rbuffer_size */
assert((size_t) k <= n - b->rbuffer_size);
b->rbuffer_size += k;
if (handle_cmsg) {
@@ -1453,6 +1455,8 @@ int bus_socket_read_message(sd_bus *bus) {
return -EXFULL;
}
/* Silence static analyzers, k is bounded by iov size: need - rbuffer_size */
assert((size_t) k <= need - bus->rbuffer_size);
bus->rbuffer_size += k;
if (handle_cmsg) {
+3
View File
@@ -3807,6 +3807,9 @@ static int process_signal(sd_event *e, struct signal_data *d, uint32_t events, i
if (_unlikely_(!SIGNAL_VALID(si.ssi_signo)))
return -EIO;
/* Silence static analyzers */
assert(si.ssi_signo < _NSIG);
if (e->signal_sources)
s = e->signal_sources[si.ssi_signo];
if (!s)