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:
Michal Schmidt
2015-09-16 23:53:32 +02:00
parent 5ee50f525f
commit a0f5ab70f3
+1 -1
View File
@@ -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;