Fix the size of memory issue 94/89894/2
authorTaejin Woo <tt.woo@samsung.com>
Tue, 27 Sep 2016 09:59:04 +0000 (18:59 +0900)
committerPyun DoHyun <dh79.pyun@samsung.com>
Tue, 27 Sep 2016 23:11:01 +0000 (16:11 -0700)
Change-Id: I16f31b396a2e6d685bc14fc3b17e1337a064cfce
Signed-off-by: Taejin Woo <tt.woo@samsung.com>
bt-api/bt-dpm.c
bt-service/bt-service-dpm.c
bt-service/bt-service-pbap.c

index cf0fecccae8f2628e6cc28afde01ff63656e1d0b..fbc7be970b9f73eb518fcdc30d45c727e8849a1a 100644 (file)
@@ -663,10 +663,10 @@ static void _bluetooth_extract_dpm_device_info(int count,
 
        for (i = 0; i < count; i++) {
                memset(dst_info->addresses[i].addr, 0,
-                       BT_ADDRESS_STRING_SIZE);
+                       BLUETOOTH_ADDRESS_LENGTH);
 
                g_strlcpy((gchar *)dst_info->addresses[i].addr, (gchar *)src_info->addresses[i].addr,
-                       BT_ADDRESS_STRING_SIZE);
+                       BLUETOOTH_ADDRESS_LENGTH);
 
 //             BT_DBG("address[%d] : %s", i, dst_info->addresses[i].addr);
        }
index 47c480501b5f1227d2c73f5ba7b2232266b10b5d..f3a067acfe515271da2408a8fcc6b38f4f76f8d1 100644 (file)
@@ -194,7 +194,7 @@ dpm_result_t _bt_dpm_get_bluetooth_devices_from_blacklist(GArray **out_param1)
        if (list) {
                ret = DPM_RESULT_SUCCESS;
                for (; list; list = list->next, i++) {
-                       memset(device_list.addresses[i].addr, 0, BT_ADDRESS_STRING_SIZE);
+                       memset(device_list.addresses[i].addr, 0, BLUETOOTH_ADDRESS_LENGTH);
                        _bt_convert_addr_string_to_type(device_list.addresses[i].addr, list->data);
                }
                device_list.count = g_slist_length(policy_table[DPM_POLICY_BLUETOOTH_DEVICES_BLACKLIST].list);
@@ -244,7 +244,7 @@ dpm_result_t _bt_dpm_get_bluetooth_devices_from_whitelist(GArray **out_param1)
        if (list) {
                ret = DPM_RESULT_SUCCESS;
                for (; list; list = list->next, i++) {
-                       memset(device_list.addresses[i].addr, 0, BT_ADDRESS_STRING_SIZE);
+                       memset(device_list.addresses[i].addr, 0, BLUETOOTH_ADDRESS_LENGTH);
                        _bt_convert_addr_string_to_type(device_list.addresses[i].addr, list->data);
 
                }
index 681f924e441a76ed822efb045f84ffdb0fe9a909..f8af67defa819deed6ed6be4fef78e3c21d61f3b 100644 (file)
@@ -945,7 +945,7 @@ int __bt_pbap_call_get_vcard(GDBusProxy *proxy, bt_pbap_data_t *pbap_data)
        char *target_file = NULL;
        char *download_path = NULL;
        char *vcard_handle = NULL;
-       char vcard[10] = { 0, };
+       char vcard[20] = { 0, };
        GVariantBuilder builder;
        GVariantBuilder inner_builder;
        GVariant *filters;