summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-27 00:27:43 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-27 00:28:22 +0100
commit2e2ec0eaa6d81ffd793c0071150cd57637410fbd (patch)
tree81fe5a06570e51434e2e26422b11770bb28c80c2 /src/libsystemd-bus
parent0058679911db806b6db2fa445a1ce879a436c9d6 (diff)
bus: refuse invalid names from kbus meta data
Diffstat (limited to 'src/libsystemd-bus')
-rw-r--r--src/libsystemd-bus/bus-kernel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index d752d1fbe3..e8f4c58110 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -873,10 +873,16 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
break;
case KDBUS_ITEM_DST_NAME:
+ if (!service_name_is_valid(d->str))
+ return -EBADMSG;
+
destination = d->str;
break;
case KDBUS_ITEM_NAME:
+ if (!service_name_is_valid(d->name.name))
+ return -EBADMSG;
+
r = strv_extend(&m->creds.well_known_names, d->name.name);
if (r < 0)
goto fail;