summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-control.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-12-19 06:55:44 +0100
committerKay Sievers <kay@vrfy.org>2013-12-19 06:56:53 +0100
commit8da4de037650c87362285055d2987614e0a46302 (patch)
tree6e7030ca77af2e0917f1e9983f3602206ac2553f /src/libsystemd-bus/bus-control.c
parenta669d6226da35d8689898b57bcb6a449046e7a3c (diff)
bus: do not add empty strings, size should be 0
Diffstat (limited to 'src/libsystemd-bus/bus-control.c')
-rw-r--r--src/libsystemd-bus/bus-control.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd-bus/bus-control.c b/src/libsystemd-bus/bus-control.c
index b8f6360fb7..5540d854d5 100644
--- a/src/libsystemd-bus/bus-control.c
+++ b/src/libsystemd-bus/bus-control.c
@@ -775,12 +775,12 @@ static int add_name_change_match(sd_bus *bus,
* name, then add KDBUS_MATCH_NAME_{ADD,REMOVE,CHANGE}
* matches for it */
- l = name ? strlen(name) : 0;
+ l = name ? strlen(name) + 1 : 0;
sz = ALIGN8(offsetof(struct kdbus_cmd_match, items) +
offsetof(struct kdbus_item, name_change) +
offsetof(struct kdbus_notify_name_change, name) +
- l+1);
+ l);
m = alloca0(sz);
m->size = sz;
@@ -791,7 +791,7 @@ static int add_name_change_match(sd_bus *bus,
item->size =
offsetof(struct kdbus_item, name_change) +
offsetof(struct kdbus_notify_name_change, name) +
- l+1;
+ l;
item->name_change.old.id = old_owner_id;
item->name_change.new.id = new_owner_id;