From 287dce5548e31b2ff1f7a3234c2ff74fb86ab2fa Mon Sep 17 00:00:00 2001 From: Adrian Szyndela Date: Tue, 13 Sep 2016 09:59:34 +0200 Subject: [PATCH] bugfix: sec_label was copied without ending byte Change-Id: I3d9aa7f2d608e6706600a87ad5dc570033244f98 --- dbus/dbus-transport-kdbus.c | 4 ++-- dbus/kdbus-common.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dbus/dbus-transport-kdbus.c b/dbus/dbus-transport-kdbus.c index e23ded2b..893a3eff 100755 --- a/dbus/dbus-transport-kdbus.c +++ b/dbus/dbus-transport-kdbus.c @@ -1923,7 +1923,7 @@ capture_org_freedesktop_DBus_GetConnectionCredentials (DBusTransportKdbus *trans dbus_bool_t res = _dbus_asv_add_byte_array (&array_iter, "LinuxSecurityLabel", info.sec_label, - strlen (info.sec_label)+1); + info.sec_label_len); dbus_free (info.sec_label); @@ -1981,7 +1981,7 @@ capture_org_freedesktop_DBus_GetConnectionSELinuxSecurityContext (DBusTransportK reply = reply_fixed_array (message, DBUS_TYPE_BYTE, info.sec_label, - strlen (info.sec_label)+1); + info.sec_label_len); dbus_free (info.sec_label); return reply; diff --git a/dbus/kdbus-common.c b/dbus/kdbus-common.c index 3b5f4205..78a0f028 100755 --- a/dbus/kdbus-common.c +++ b/dbus/kdbus-common.c @@ -987,7 +987,7 @@ decode_connection_info (struct kdbus_info *connection_info, case KDBUS_ITEM_SECLABEL: if (get_sec_label) { - pInfo->sec_label_len = item->size - KDBUS_ITEM_HEADER_SIZE - 1; + pInfo->sec_label_len = item->size - KDBUS_ITEM_HEADER_SIZE; if (0 != pInfo->sec_label_len) { pInfo->sec_label = dbus_malloc (pInfo->sec_label_len); -- 2.34.1