summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-control.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd/sd-bus/bus-control.c')
-rw-r--r--src/libsystemd/sd-bus/bus-control.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
index 39f4fc83a7..5a052d455e 100644
--- a/src/libsystemd/sd-bus/bus-control.c
+++ b/src/libsystemd/sd-bus/bus-control.c
@@ -495,8 +495,8 @@ static int bus_populate_creds_from_items(sd_bus *bus,
SD_BUS_CREDS_INHERITABLE_CAPS | SD_BUS_CREDS_BOUNDING_CAPS) & mask;
if (m) {
- c->capability_size = item->size - KDBUS_ITEM_HEADER_SIZE;
- c->capability = memdup(item->data, c->capability_size);
+ c->capability_size = item->size - offsetof(struct kdbus_item, caps.caps);
+ c->capability = memdup(item->caps.caps, c->capability_size);
if (!c->capability)
return -ENOMEM;