chiark / gitweb /
bus: refuse invalid names from kbus meta data
authorLennart Poettering <lennart@poettering.net>
Thu, 26 Dec 2013 23:27:43 +0000 (00:27 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 26 Dec 2013 23:28:22 +0000 (00:28 +0100)
src/libsystemd-bus/bus-kernel.c

index d752d1f..e8f4c58 100644 (file)
@@ -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;