mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-08 01:38:35 +00:00
sd-bus: correct size calculation in DBus fd receive
The size of the allocated array for received file descriptors was incorrectly calculated. This did not matter when a single file descriptor was received, but for more descriptors the allocation was insufficient.
This commit is contained in:
@@ -985,7 +985,7 @@ int bus_socket_read_message(sd_bus *bus) {
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
f = realloc(bus->fds, sizeof(int) + (bus->n_fds + n));
|
||||
f = realloc(bus->fds, sizeof(int) * (bus->n_fds + n));
|
||||
if (!f) {
|
||||
close_many((int*) CMSG_DATA(cmsg), n);
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user