From: Radoslaw Pajak Date: Tue, 3 Dec 2013 09:22:29 +0000 (+0100) Subject: [daemon-fix] Fixed kdbus bus address recognition X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d86c59182fa7b204e4f952301bc0fd75c3ec3e1;p=platform%2Fupstream%2Fdbus.git [daemon-fix] Fixed kdbus bus address recognition Change-Id: Icf75319d831a315f4e739fb9ac094b4cd95faa88 Signed-off-by: Radoslaw Pajak --- diff --git a/bus/bus.c b/bus/bus.c index 485a6fd..8698db2 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -433,7 +433,7 @@ process_config_first_time_only (BusContext *context, if (address) { #ifdef ENABLE_KDBUS_TRANSPORT - if(strcmp(_dbus_string_get_const_data(address), "kdbus:") >= 0) + if(!strncmp(_dbus_string_get_const_data(address), "kdbus:", strlen("kdbus:"))) { DBusBusType type; DBusServer* server; diff --git a/bus/kdbus-d.c b/bus/kdbus-d.c index 3e247be..933f55d 100644 --- a/bus/kdbus-d.c +++ b/bus/kdbus-d.c @@ -334,8 +334,16 @@ char* make_kdbus_bus(DBusBusType type, const char* address, DBusError *error) memset(&bus_make, 0, sizeof(bus_make)); bus_make.head.bloom_size = 64; bus_make.head.flags = KDBUS_MAKE_ACCESS_WORLD; - if(!strcmp(addr_value, "sbb")) - bus_make.head.flags |= KDBUS_MAKE_SBB_OFFSET; + if(*addr_value) + { + if(!strcmp(addr_value, "sbb")) + bus_make.head.flags |= KDBUS_MAKE_SBB_OFFSET; + else + { + dbus_set_error_const(error, DBUS_ERROR_BAD_ADDRESS, "Invalid address parameter."); + return NULL; + } + } if(type == DBUS_BUS_SYSTEM) snprintf(bus_make.name, sizeof(bus_make.name), "%u-kdbus-%s", getuid(), "system");