From: Wootak Jung Date: Thu, 24 May 2018 03:38:12 +0000 (+0900) Subject: Fix prevent issues X-Git-Tag: accepted/tizen/unified/20180524.060223~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8898d956897af53f2e76b6626b59411df58b178c;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Fix prevent issues Change-Id: Iadec24b45ee77613553e75ef89103dd135046362 --- diff --git a/bt-api/bt-hid-device.c b/bt-api/bt-hid-device.c index b287ca7..cfbb33c 100644 --- a/bt-api/bt-hid-device.c +++ b/bt-api/bt-hid-device.c @@ -286,7 +286,7 @@ static gboolean __received_cb(GIOChannel *chan, GIOCondition cond, &len, &err); if (status == G_IO_STATUS_NORMAL) { BT_INFO("Parsing Data"); - bluetooth_hid_received_data_t data = {0}; + bluetooth_hid_received_data_t recv_data = {0}; header = buffer[0]; type = header & BT_HID_HEADER_TRANS_MASK; param = header & BT_HID_HEADER_PARAM_MASK; @@ -297,121 +297,121 @@ static gboolean __received_cb(GIOChannel *chan, GIOCondition cond, if (event_info == NULL) return FALSE; - data.address = g_strdup(info->address); + recv_data.address = g_strdup(info->address); switch (type) { case BT_HID_TRANS_HANDSHAKE: BT_INFO("TRANS HANDSHAKE"); - data.type = HTYPE_TRANS_HANDSHAKE; - data.buffer_size = len; - data.buffer = (char *) malloc(sizeof(char) * len); - if (data.buffer) - memcpy(data.buffer, buffer, len); + recv_data.type = HTYPE_TRANS_HANDSHAKE; + recv_data.buffer_size = len; + recv_data.buffer = (char *) malloc(sizeof(char) * len); + if (recv_data.buffer) + memcpy(recv_data.buffer, buffer, len); break; case BT_HID_TRANS_HID_CONTROL: BT_INFO("HID CONTROL"); - data.type = HTYPE_TRANS_HID_CONTROL; - data.buffer_size = len; - data.buffer = (char *) malloc(sizeof(char) * len); - if (data.buffer) - memcpy(data.buffer, buffer, len); + recv_data.type = HTYPE_TRANS_HID_CONTROL; + recv_data.buffer_size = len; + recv_data.buffer = (char *) malloc(sizeof(char) * len); + if (recv_data.buffer) + memcpy(recv_data.buffer, buffer, len); break; case BT_HID_TRANS_DATA: BT_INFO("TRANS DATA"); - data.type = HTYPE_TRANS_DATA; + recv_data.type = HTYPE_TRANS_DATA; if (param & BT_HID_DATA_RTYPE_INPUT) { BT_INFO("Input Report"); - data.param = PTYPE_DATA_RTYPE_INPUT; - data.buffer_size = len; - data.buffer = (char *) malloc(sizeof(char) * len); - if (data.buffer) - memcpy(data.buffer, buffer, len); + recv_data.param = PTYPE_DATA_RTYPE_INPUT; + recv_data.buffer_size = len; + recv_data.buffer = (char *) malloc(sizeof(char) * len); + if (recv_data.buffer) + memcpy(recv_data.buffer, buffer, len); } else { BT_INFO("Out Report"); - data.param = PTYPE_DATA_RTYPE_OUTPUT; - data.buffer_size = len; - data.buffer = (char *) malloc(sizeof(char) * len); - if (data.buffer) - memcpy(data.buffer, buffer, len); + recv_data.param = PTYPE_DATA_RTYPE_OUTPUT; + recv_data.buffer_size = len; + recv_data.buffer = (char *) malloc(sizeof(char) * len); + if (recv_data.buffer) + memcpy(recv_data.buffer, buffer, len); } break; case BT_HID_TRANS_GET_REPORT: { BT_INFO("Get Report"); - data.type = HTYPE_TRANS_GET_REPORT; + recv_data.type = HTYPE_TRANS_GET_REPORT; if (param & BT_HID_DATA_RTYPE_INPUT) { BT_INFO("Input Report"); - data.param = PTYPE_DATA_RTYPE_INPUT; + recv_data.param = PTYPE_DATA_RTYPE_INPUT; } else { BT_INFO("Output Report"); - data.param = PTYPE_DATA_RTYPE_OUTPUT; + recv_data.param = PTYPE_DATA_RTYPE_OUTPUT; } - data.buffer_size = len; - data.buffer = (char *) malloc(sizeof(char) * len); - if (data.buffer) - memcpy(data.buffer, buffer, len); + recv_data.buffer_size = len; + recv_data.buffer = (char *) malloc(sizeof(char) * len); + if (recv_data.buffer) + memcpy(recv_data.buffer, buffer, len); break; } case BT_HID_TRANS_SET_REPORT: { BT_INFO("Set Report"); - data.type = HTYPE_TRANS_SET_REPORT; + recv_data.type = HTYPE_TRANS_SET_REPORT; if (param & BT_HID_DATA_RTYPE_INPUT) { BT_INFO("Input Report"); - data.param = PTYPE_DATA_RTYPE_INPUT; + recv_data.param = PTYPE_DATA_RTYPE_INPUT; } else { BT_INFO("Output Report"); - data.param = PTYPE_DATA_RTYPE_OUTPUT; + recv_data.param = PTYPE_DATA_RTYPE_OUTPUT; } - data.buffer_size = len; - data.buffer = (char *) malloc(sizeof(char) * len); - if (data.buffer) - memcpy(data.buffer, buffer, len); + recv_data.buffer_size = len; + recv_data.buffer = (char *) malloc(sizeof(char) * len); + if (recv_data.buffer) + memcpy(recv_data.buffer, buffer, len); break; } case BT_HID_TRANS_GET_PROTOCOL:{ BT_INFO("Get_PROTOCOL"); - data.type = HTYPE_TRANS_GET_PROTOCOL; - data.param = PTYPE_DATA_RTYPE_INPUT; - data.buffer_size = len; - data.buffer = (char *) malloc(sizeof(char) * len); - if (data.buffer) - memcpy(data.buffer, buffer, len); + recv_data.type = HTYPE_TRANS_GET_PROTOCOL; + recv_data.param = PTYPE_DATA_RTYPE_INPUT; + recv_data.buffer_size = len; + recv_data.buffer = (char *) malloc(sizeof(char) * len); + if (recv_data.buffer) + memcpy(recv_data.buffer, buffer, len); break; } case BT_HID_TRANS_SET_PROTOCOL:{ BT_INFO("Set_PROTOCOL"); - data.type = HTYPE_TRANS_SET_PROTOCOL; - data.param = PTYPE_DATA_RTYPE_INPUT; - data.buffer_size = len; - data.buffer = (char *) malloc(sizeof(char) * len); - if (data.buffer) - memcpy(data.buffer, buffer, len); + recv_data.type = HTYPE_TRANS_SET_PROTOCOL; + recv_data.param = PTYPE_DATA_RTYPE_INPUT; + recv_data.buffer_size = len; + recv_data.buffer = (char *) malloc(sizeof(char) * len); + if (recv_data.buffer) + memcpy(recv_data.buffer, buffer, len); break; } case BT_HID_TRANS_GET_IDLE:{ BT_INFO("Get_IDLE"); - data.type = HTYPE_TRANS_GET_IDLE; - data.param = PTYPE_DATA_RTYPE_INPUT; - data.buffer_size = len; - data.buffer = (char *) malloc(sizeof(char) * len); - if (data.buffer) - memcpy(data.buffer, buffer, len); + recv_data.type = HTYPE_TRANS_GET_IDLE; + recv_data.param = PTYPE_DATA_RTYPE_INPUT; + recv_data.buffer_size = len; + recv_data.buffer = (char *) malloc(sizeof(char) * len); + if (recv_data.buffer) + memcpy(recv_data.buffer, buffer, len); break; } case BT_HID_TRANS_SET_IDLE:{ BT_INFO("Set_IDLE"); - data.type = HTYPE_TRANS_SET_IDLE; - data.param = PTYPE_DATA_RTYPE_INPUT; - data.buffer_size = len; - data.buffer = (char *) malloc(sizeof(char) * len); - if (data.buffer) - memcpy(data.buffer, buffer, len); + recv_data.type = HTYPE_TRANS_SET_IDLE; + recv_data.param = PTYPE_DATA_RTYPE_INPUT; + recv_data.buffer_size = len; + recv_data.buffer = (char *) malloc(sizeof(char) * len); + if (recv_data.buffer) + memcpy(recv_data.buffer, buffer, len); break; } @@ -420,7 +420,7 @@ static gboolean __received_cb(GIOChannel *chan, GIOCondition cond, BT_ERR("Send Handshake Message"); guint8 type = BT_HID_TRANS_HANDSHAKE | BT_HID_HSHK_ERR_UNSUPPORTED_REQUEST; - data.type = HTYPE_TRANS_UNKNOWN; + recv_data.type = HTYPE_TRANS_UNKNOWN; int fd = g_io_channel_unix_get_fd(chan); int bytes = write(fd, &type, sizeof(type)); BT_INFO("Bytes Written %d", bytes); @@ -429,13 +429,13 @@ static gboolean __received_cb(GIOChannel *chan, GIOCondition cond, } _bt_common_event_cb(BLUETOOTH_HID_DEVICE_DATA_RECEIVED, - BLUETOOTH_ERROR_NONE, &data, + BLUETOOTH_ERROR_NONE, &recv_data, event_info->cb, event_info->user_data); - if (data.buffer) - g_free(data.buffer); + if (recv_data.buffer) + g_free(recv_data.buffer); - if (data.address) - g_free((char *)data.address); + if (recv_data.address) + g_free((char *)recv_data.address); } else { BT_ERR("Error while reading data %d [%s]", status, info->address); if (err) { diff --git a/bt-oal/bluez_hal/src/bt-hal-bluetooth.c b/bt-oal/bluez_hal/src/bt-hal-bluetooth.c index 489e2d1..ab7eb04 100644 --- a/bt-oal/bluez_hal/src/bt-hal-bluetooth.c +++ b/bt-oal/bluez_hal/src/bt-hal-bluetooth.c @@ -467,6 +467,10 @@ static int open_bluetooth(const struct hw_module_t *module, char const *name, bluetooth_device_t *dev = malloc(sizeof(bluetooth_device_t)); DBG(""); + if (!dev) { + ERR("dev is NULL"); + return 0; + } memset(dev, 0, sizeof(bluetooth_device_t)); dev->common.tag = HARDWARE_DEVICE_TAG; diff --git a/bt-oal/bluez_hal/src/bt-hal-dbus-common-utils.c b/bt-oal/bluez_hal/src/bt-hal-dbus-common-utils.c index ce445db..39d465d 100644 --- a/bt-oal/bluez_hal/src/bt-hal-dbus-common-utils.c +++ b/bt-oal/bluez_hal/src/bt-hal-dbus-common-utils.c @@ -1677,7 +1677,7 @@ int _bt_hal_discover_service_uuids(char *address, char *remote_uuid) GDBusConnection *gconn; GError *err = NULL; char **uuid_value = NULL; - gsize size; + gsize size = 0; int i = 0; GVariant *value = NULL; GVariant *ret = NULL; diff --git a/bt-oal/bluez_hal/src/bt-hal-event-receiver.c b/bt-oal/bluez_hal/src/bt-hal-event-receiver.c index fc85885..76223ea 100644 --- a/bt-oal/bluez_hal/src/bt-hal-event-receiver.c +++ b/bt-oal/bluez_hal/src/bt-hal-event-receiver.c @@ -204,7 +204,7 @@ static void __bt_hal_adapter_property_changed_event(GVariant *msg) unsigned int scan_mode = BT_SCAN_MODE_NONE; unsigned int disc_timeout; const gchar *version; - const gboolean ipsp_initialized; + gboolean ipsp_initialized; gboolean powered; gboolean pairable; unsigned int pairable_timeout; diff --git a/bt-oal/bluez_hal/src/bt-hal-gap-agent.c b/bt-oal/bluez_hal/src/bt-hal-gap-agent.c index c72d920..6ce95a1 100644 --- a/bt-oal/bluez_hal/src/bt-hal-gap-agent.c +++ b/bt-oal/bluez_hal/src/bt-hal-gap-agent.c @@ -468,7 +468,6 @@ static void __bt_gap_agent_method(GDBusConnection *connection, GError *err = NULL; if (g_strcmp0(method_name, "RequestPinCode") == 0) { GapAgentPrivate *agent = user_data; - char *sender = (char *)g_dbus_method_invocation_get_sender(invocation); GDBusProxy *device; char *addr; char *path; @@ -523,7 +522,6 @@ static void __bt_gap_agent_method(GDBusConnection *connection, return; } else if (g_strcmp0(method_name, "RequestPasskey") == 0) { GapAgentPrivate *priv = user_data; - char *sender = (char *)g_dbus_method_invocation_get_sender(invocation); GDBusProxy *device; char *addr; char *path; @@ -579,7 +577,6 @@ static void __bt_gap_agent_method(GDBusConnection *connection, return; } else if (g_strcmp0(method_name, "DisplayPasskey") == 0) { GapAgentPrivate *priv = user_data; - char *sender = (char *)g_dbus_method_invocation_get_sender(invocation); GDBusProxy *device; guint passkey; guint16 entered; @@ -627,7 +624,6 @@ static void __bt_gap_agent_method(GDBusConnection *connection, return; } else if (g_strcmp0(method_name, "RequestConfirmation") == 0) { GapAgentPrivate *priv = user_data; - char *sender = (char *)g_dbus_method_invocation_get_sender(invocation); GDBusProxy *device; guint passkey; char *path; @@ -685,7 +681,6 @@ static void __bt_gap_agent_method(GDBusConnection *connection, return; } else if (g_strcmp0(method_name, "AuthorizeService") == 0) { GapAgentPrivate *priv = user_data; - char *sender = (char *)g_dbus_method_invocation_get_sender(invocation); GDBusProxy *device; GDBusConnection *conn; char *addr; @@ -756,7 +751,6 @@ static void __bt_gap_agent_method(GDBusConnection *connection, g_dbus_method_invocation_return_value(invocation, NULL); } else if (g_strcmp0(method_name, "Cancel") == 0) { GapAgentPrivate *priv = user_data; - char *sender = (char *)g_dbus_method_invocation_get_sender(invocation); if (sender == NULL) return; @@ -797,7 +791,6 @@ static void __bt_gap_agent_method(GDBusConnection *connection, return; } else if (g_strcmp0(method_name, "Release") == 0) { GapAgentPrivate *priv = user_data; - char *sender = (char *)g_dbus_method_invocation_get_sender(invocation); if (sender == NULL) return; @@ -824,7 +817,7 @@ static void __bt_gap_agent_method(GDBusConnection *connection, } else if (g_strcmp0(method_name, "ReplyPinCode") == 0) { GapAgentPrivate *priv = user_data; const char *pin_code; - const guint accept; + guint accept; g_variant_get(parameters, "(u&s)", &accept, &pin_code); DBG("Accept: %d PinCode: %s", accept, pin_code); @@ -832,21 +825,21 @@ static void __bt_gap_agent_method(GDBusConnection *connection, } else if (g_strcmp0(method_name, "ReplyPasskey") == 0) { GapAgentPrivate *priv = user_data; const char *passkey; - const guint accept; + guint accept; g_variant_get(parameters, "(u&s)", &accept, &passkey); DBG("Accept: %d PinCode: %s", accept, passkey); gap_agent_reply_passkey(priv, accept, passkey, invocation); } else if (g_strcmp0(method_name, "ReplyConfirmation") == 0) { GapAgentPrivate *priv = user_data; - const guint accept; + guint accept; g_variant_get(parameters, "(u)", &accept); DBG("Accept: %d", accept); gap_agent_reply_confirmation(priv, accept, invocation); } else if (g_strcmp0(method_name, "ReplyAuthorize") == 0) { GapAgentPrivate *priv = user_data; - const guint accept; + guint accept; g_variant_get(parameters, "(u)", &accept); DBG("Accept: %d", accept); diff --git a/bt-oal/bluez_hal/src/bt-hal-gatt-client.c b/bt-oal/bluez_hal/src/bt-hal-gatt-client.c index 5b8b6d9..ec6f955 100644 --- a/bt-oal/bluez_hal/src/bt-hal-gatt-client.c +++ b/bt-oal/bluez_hal/src/bt-hal-gatt-client.c @@ -836,11 +836,13 @@ static bt_status_t _gattc_client_search_service(int conn_id) } } - DBG("send search service result event"); - _bt_hal_send_search_service_result_event(conn_id, is_primary, - uuid_str, conn_info->inst_id); + if (uuid_str) { + DBG("send search service result event"); + _bt_hal_send_search_service_result_event(conn_id, is_primary, + uuid_str, conn_info->inst_id); - _gattc_create_new_service(conn_info, is_primary, uuid_str, object_path, gp_char_array); + _gattc_create_new_service(conn_info, is_primary, uuid_str, object_path, gp_char_array); + } } } diff --git a/bt-oal/bluez_hal/src/bt-hal-utils.c b/bt-oal/bluez_hal/src/bt-hal-utils.c index 00073c0..ce17e91 100644 --- a/bt-oal/bluez_hal/src/bt-hal-utils.c +++ b/bt-oal/bluez_hal/src/bt-hal-utils.c @@ -44,7 +44,7 @@ const char *bt_uuid_t2str(const uint8_t *uuid, char *buf) int is_bt; if (!uuid) - return strncpy(buf, "NULL", strlen("NULL")); + return strncpy(buf, "NULL", strlen("NULL") + 1); is_bt = !memcmp(&uuid[4], &BT_BASE_UUID[4], HAL_UUID_LEN - 4); @@ -104,7 +104,7 @@ const char *bt_bdaddr_t2str(const bt_bdaddr_t *bd_addr, char *buf) const uint8_t *p; if (!bd_addr) - return strncpy(buf, "NULL", strlen("NULL")); + return strncpy(buf, "NULL", strlen("NULL") + 1); p = bd_addr->address; diff --git a/bt-oal/oal-gatt.c b/bt-oal/oal-gatt.c index ef38eeb..72cace4 100644 --- a/bt-oal/oal-gatt.c +++ b/bt-oal/oal-gatt.c @@ -1011,9 +1011,6 @@ oal_status_t gatts_update_att_value(int ins_id, oal_gatt_value_t *value) { int ret = OAL_STATUS_SUCCESS; - API_TRACE("Server Update Value: Ins_id = [%d], att handle = [%d] data len [%d]", - ins_id, value->handle, value->len); - CHECK_OAL_GATT_ENABLED(); CHECK_SERVER_INSTANCE(ins_id); @@ -1025,6 +1022,9 @@ oal_status_t gatts_update_att_value(int ins_id, oal_gatt_value_t *value) return OAL_STATUS_INVALID_PARAM; } + API_TRACE("Server Update Value: Ins_id = [%d], att handle = [%d] data len [%d]", + ins_id, value->handle, value->len); + ret = gatt_api->server->update_att_value(gatt_servers[ins_id - 1].server_id, (int)value->handle, (int)value->len, (char*)value->value); diff --git a/bt-oal/oal-hid-host.c b/bt-oal/oal-hid-host.c index c6dac89..eb95e46 100755 --- a/bt-oal/oal-hid-host.c +++ b/bt-oal/oal-hid-host.c @@ -194,6 +194,8 @@ static void connection_state_callback(bt_bdaddr_t *bd_addr, bthh_connection_stat BT_DBG("%d", state); + if (!event) + return; memcpy(event->address.addr, bd_addr->address, BT_ADDRESS_BYTES_NUM); event->status = OAL_STATUS_SUCCESS; @@ -207,8 +209,7 @@ static void connection_state_callback(bt_bdaddr_t *bd_addr, bthh_connection_stat break; case BTHH_CONN_STATE_CONNECTING: case BTHH_CONN_STATE_DISCONNECTING: - if (event) - g_free(event); + g_free(event); return; case BTHH_CONN_STATE_FAILED_MOUSE_FROM_HOST: event_type = OAL_EVENT_HID_DISCONNECTED; @@ -225,8 +226,7 @@ static void connection_state_callback(bt_bdaddr_t *bd_addr, bthh_connection_stat case BTHH_CONN_STATE_UNKNOWN: default: BT_ERR("Unhandled Connection state %d", state); - if (event) - g_free(event); + g_free(event); return; } diff --git a/bt-service-adaptation/services/adapter/bt-service-core-adapter.c b/bt-service-adaptation/services/adapter/bt-service-core-adapter.c index 40cd1e2..cc96a7e 100644 --- a/bt-service-adaptation/services/adapter/bt-service-core-adapter.c +++ b/bt-service-adaptation/services/adapter/bt-service-core-adapter.c @@ -507,7 +507,7 @@ int _bt_set_discoverable_mode(int discoverable_mode, int timeout) _bt_dpm_get_bluetooth_limited_discoverable_state(&discoverable_state); if (discoverable_mode != BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE && discoverable_state == DPM_RESTRICTED) { - if (headed_plugin_info->plugin_headed_enabled) + if (headed_plugin_info->plugin_headed_enabled) // TODO: There is no definition headed_plugin_info headed_plugin_info->headed_plugin->bt_launch_dpmpopup("DPM_POLICY_DISABLE_BT_HANDSFREE"); return BLUETOOTH_ERROR_ACCESS_DENIED; } diff --git a/bt-service-adaptation/services/bt-request-handler.c b/bt-service-adaptation/services/bt-request-handler.c index 83085ce..12d6f0f 100644 --- a/bt-service-adaptation/services/bt-request-handler.c +++ b/bt-service-adaptation/services/bt-request-handler.c @@ -281,7 +281,6 @@ static void __bt_service_method(GDBusConnection *connection, GVariant *temp = NULL; int result = 0; int request_id = -1; - const char *sender = NULL; g_variant_get(parameters, "(iii@ay@ay@ay@ay@ay)", &service_type, &service_function, &request_type, @@ -289,8 +288,6 @@ static void __bt_service_method(GDBusConnection *connection, out_param1 = g_array_new(FALSE, FALSE, sizeof(gchar)); - sender = g_dbus_method_invocation_get_sender(invocation); - if (service_type == BT_CORE_SERVICE) { BT_DBG("No need to check privilege from bt-core"); } else if (__bt_service_check_privilege(service_function, diff --git a/bt-service-adaptation/services/obex/bt-service-obex-agent.c b/bt-service-adaptation/services/obex/bt-service-obex-agent.c index ad9b40b..b1d1ee2 100755 --- a/bt-service-adaptation/services/obex/bt-service-obex-agent.c +++ b/bt-service-adaptation/services/obex/bt-service-obex-agent.c @@ -173,7 +173,6 @@ static void __new_connection_method(GDBusConnection *connection, } else if (g_strcmp0(method_name, "Authorize") == 0) { g_dbus_method_invocation_return_value(invocation, NULL); } else if (g_strcmp0(method_name, "Request") == 0) { - char *sender; bt_obex_agent_info *info; GDBusProxy *proxy; char *path = NULL; @@ -188,8 +187,6 @@ static void __new_connection_method(GDBusConnection *connection, if (conn == NULL) goto fail; - sender = (char *)g_dbus_method_invocation_get_sender(invocation); - if (info->name == NULL) { info->name = sender; } else { @@ -222,7 +219,6 @@ static void __new_connection_method(GDBusConnection *connection, BT_DBG("+"); bt_obex_agent_info *info; - char *sender; char *path = NULL; gint64 transferred; GDBusProxy *proxy; @@ -236,8 +232,6 @@ static void __new_connection_method(GDBusConnection *connection, if (conn == NULL) goto fail; - sender = (char *)g_dbus_method_invocation_get_sender(invocation); - if (g_strcmp0(sender, info->name) != 0) goto fail; @@ -267,7 +261,6 @@ static void __new_connection_method(GDBusConnection *connection, return; } else if (g_strcmp0(method_name, "Error") == 0) { bt_obex_agent_info *info; - char *sender; GDBusProxy *proxy; char *path, *message; GError *err = NULL; @@ -280,8 +273,6 @@ static void __new_connection_method(GDBusConnection *connection, if (conn == NULL) goto fail; - sender = (char *)g_dbus_method_invocation_get_sender(invocation); - if (g_strcmp0(sender, info->name) != 0) goto fail; @@ -306,7 +297,6 @@ static void __new_connection_method(GDBusConnection *connection, return; } else if (g_strcmp0(method_name, "Complete") == 0) { bt_obex_agent_info *info; - char *sender; GDBusProxy *proxy; char *path = NULL; GError *err = NULL; @@ -319,8 +309,6 @@ static void __new_connection_method(GDBusConnection *connection, if (conn == NULL) goto fail; - sender = (char *)g_dbus_method_invocation_get_sender(invocation); - if (g_strcmp0(sender, info->name) != 0) goto fail; @@ -347,15 +335,12 @@ static void __new_connection_method(GDBusConnection *connection, return; } else if (g_strcmp0(method_name, "Release") == 0) { bt_obex_agent_info *info; - char *sender; info = __find_obex_agent_info((char *)object_path); if (info == NULL) goto fail; - sender = (char *)g_dbus_method_invocation_get_sender(invocation); - if (info->name) { /*In H2 if user denies auth,release will come without request and hence info->name will be NULL */ @@ -370,7 +355,7 @@ static void __new_connection_method(GDBusConnection *connection, return; } else if (g_strcmp0(method_name, "ReplyAuthorize") == 0) { - const guint accept; + guint accept; g_variant_get(parameters, "(u)", &accept); BT_DBG("Accept: %d", accept);