From 9fb3bd46c0b4c9585a650da466e736e8445865cb Mon Sep 17 00:00:00 2001 From: Wootak Jung Date: Fri, 6 Aug 2021 14:21:40 +0900 Subject: [PATCH] Fix coverity issue param should be initialized Change-Id: I5da0ab3ad7f6a74322038b97357e7141f2983ac3 Signed-off-by: Wootak Jung --- bt-service/services/gatt/bt-service-gatt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bt-service/services/gatt/bt-service-gatt.c b/bt-service/services/gatt/bt-service-gatt.c index bf93e24..83fed75 100644 --- a/bt-service/services/gatt/bt-service-gatt.c +++ b/bt-service/services/gatt/bt-service-gatt.c @@ -1009,6 +1009,7 @@ static void __bt_gatt_cleanup_invocation_on_gatt_disconnection(int result, case BT_GATT_GET_PRIMARY_SERVICES: { if(!g_strcmp0((char*)req_info->user_data, (char*)data)){ bt_services_browse_info_t param; + memset(¶m, 0, sizeof(bt_services_browse_info_t)); _bt_convert_addr_string_to_type(param.device_addr.addr, (char*)data); out_param = g_array_new(FALSE, FALSE, sizeof(gchar)); g_array_append_vals(out_param, ¶m, sizeof(bt_services_browse_info_t)); @@ -1024,6 +1025,7 @@ static void __bt_gatt_cleanup_invocation_on_gatt_disconnection(int result, _bt_convert_addr_type_to_string(addr, prop->device_address.addr); if (!g_strcmp0(addr, (char*)data)){ bt_char_browse_info_t param; + memset(¶m, 0, sizeof(bt_char_browse_info_t)); _bt_convert_addr_string_to_type(param.device_addr.addr,addr); out_param = g_array_new(FALSE, FALSE, sizeof(gchar)); g_array_append_vals(out_param, ¶m, sizeof(bt_char_browse_info_t)); @@ -1038,7 +1040,8 @@ static void __bt_gatt_cleanup_invocation_on_gatt_disconnection(int result, bluetooth_gatt_client_char_prop_info_t *prop = (bluetooth_gatt_client_char_prop_info_t*)req_info->user_data; _bt_convert_addr_type_to_string(addr, prop->device_address.addr); if (!g_strcmp0(addr, (char*)data)){ - bt_descriptor_browse_info_t param ; + bt_descriptor_browse_info_t param; + memset(¶m, 0, sizeof(bt_descriptor_browse_info_t)); _bt_convert_addr_string_to_type(param.device_addr.addr, addr); out_param = g_array_new(FALSE, FALSE, sizeof(gchar)); g_array_append_vals(out_param, ¶m, sizeof(bt_descriptor_browse_info_t)); @@ -1054,6 +1057,7 @@ static void __bt_gatt_cleanup_invocation_on_gatt_disconnection(int result, _bt_convert_addr_type_to_string(addr, prop->device_address.addr); if (!g_strcmp0(addr, (char*)data)){ bt_gatt_notif_reg_info_t param; + memset(¶m, 0, sizeof(bt_gatt_notif_reg_info_t)); _bt_convert_addr_string_to_type(param.addr.addr, addr); out_param = g_array_new(FALSE, FALSE, sizeof(gchar)); g_array_append_vals(out_param, ¶m, sizeof(bt_gatt_notif_reg_info_t)); -- 2.7.4