X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flibsystemd-bus%2Fbus-control.c;h=2acd20ba48eb27587ae7d504bc25a1052aa386a7;hp=f08d78a7891d1a40dbef1abe4247ce952d80d4ac;hb=dff91e8b7fa396284768a22b62c36dbe23a3b206;hpb=c20733832fdfc780380f1b276655d69782057e49 diff --git a/src/libsystemd-bus/bus-control.c b/src/libsystemd-bus/bus-control.c index f08d78a78..2acd20ba4 100644 --- a/src/libsystemd-bus/bus-control.c +++ b/src/libsystemd-bus/bus-control.c @@ -803,7 +803,7 @@ static int add_name_change_match(sd_bus *bus, item->name_change.new.id = new_owner_id; if (name) - strcpy(item->name_change.name, name); + memcpy(item->name_change.name, name, l); /* If the old name is unset or empty, then * this can match against added names */ @@ -854,7 +854,9 @@ static int add_name_change_match(sd_bus *bus, m->cookie = cookie; item = m->items; - item->size = offsetof(struct kdbus_item, id_change) + sizeof(struct kdbus_notify_id_change); + item->size = + offsetof(struct kdbus_item, id_change) + + sizeof(struct kdbus_notify_id_change); item->id_change.id = name_id; /* If the old name is unset or empty, then this can