bugfix: sec_label was copied without ending byte 74/88074/1 accepted/tizen/common/20160919.154452 accepted/tizen/ivi/20160920.051616 accepted/tizen/mobile/20160920.051520 accepted/tizen/tv/20160920.051534 accepted/tizen/wearable/20160920.051557 submit/tizen/20160919.053144
authorAdrian Szyndela <adrian.s@samsung.com>
Tue, 13 Sep 2016 07:59:34 +0000 (09:59 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Tue, 13 Sep 2016 08:00:42 +0000 (10:00 +0200)
Change-Id: I3d9aa7f2d608e6706600a87ad5dc570033244f98

dbus/dbus-transport-kdbus.c
dbus/kdbus-common.c

index e23ded2beeaca4f1622f60c4ccefd71333fc96c1..893a3effa097bf1014a7d05ec8bb7c89cfe2e02b 100755 (executable)
@@ -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;
index 3b5f4205987cab8875fe264657898d17c2ebf9c9..78a0f02858954ce9269a0a676d4fc63475a7265c 100755 (executable)
@@ -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);