projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ee50f5
)
sd-bus: correct size calculation in DBus fd receive
author
Michal Schmidt
<mschmidt@redhat.com>
Wed, 16 Sep 2015 20:55:02 +0000
(22:55 +0200)
committer
Michal Schmidt
<mschmidt@redhat.com>
Wed, 16 Sep 2015 21:53:32 +0000
(23:53 +0200)
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.
src/libsystemd/sd-bus/bus-socket.c
patch
|
blob
|
history
diff --git
a/src/libsystemd/sd-bus/bus-socket.c
b/src/libsystemd/sd-bus/bus-socket.c
index
735a775
..
d0b1e3d
100644
(file)
--- 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;