diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2015-09-16 22:55:02 +0200 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2015-09-16 23:53:32 +0200 |
commit | a0f5ab70f367aa105bee3be4b1bb5fa27ec522d1 (patch) | |
tree | d336c017fdf2d4853819f1e4b211dc0f2b25043f /src | |
parent | Merge pull request #1269 from zonque/netcls (diff) | |
download | systemd-a0f5ab70f367aa105bee3be4b1bb5fa27ec522d1.tar.xz systemd-a0f5ab70f367aa105bee3be4b1bb5fa27ec522d1.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd/sd-bus/bus-socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c index 735a775cb4..d0b1e3d7dc 100644 --- a/src/libsystemd/sd-bus/bus-socket.c +++ b/src/libsystemd/sd-bus/bus-socket.c @@ -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; |