Fix the coverity issue (Dereference after null check)
[platform/core/connectivity/bluetooth-frwk.git] / bt-service-adaptation / services / socket / bt-service-socket.c
index a51dfde..71d9c3c 100644 (file)
@@ -212,7 +212,11 @@ int _bt_socket_client_connect(int sock_type, char *address,
        pending_conn_info->chan = channel;
        pending_conn_info->conn_cb = cb;
        g_strlcpy(pending_conn_info->address, address, BT_ADDRESS_STRING_SIZE);
-       g_strlcpy(pending_conn_info->uuid, remote_uuid, BT_UUID_STRING_SIZE);
+
+       if (remote_uuid != NULL)
+               g_strlcpy(pending_conn_info->uuid, remote_uuid, BT_UUID_STRING_SIZE);
+       else
+               memset(pending_conn_info->uuid, 0x00, BT_UUID_STRING_SIZE);
 
        BT_DBG("-");
        return BLUETOOTH_ERROR_NONE;