summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-23 02:08:05 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-23 04:20:55 +0100
commitdff91e8b7fa396284768a22b62c36dbe23a3b206 (patch)
tree21d26a4a0c213c46a99b69d248cd50c8393c030b /src
parentb67f541f130cd4c55da0b74af5fcbb4daeca1937 (diff)
bus: use memcpy() rather than unbounded strcpy()
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-bus/bus-control.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libsystemd-bus/bus-control.c b/src/libsystemd-bus/bus-control.c
index f08d78a789..2acd20ba48 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