From: Abhijit RD Date: Tue, 24 Dec 2013 11:00:35 +0000 (+0530) Subject: NFC Bug fixes X-Git-Tag: accepted/tizen/generic/20140408.093248~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4128b9c0eaf8e72d8db0270413867dcceb15fef;p=platform%2Fcore%2Fconnectivity%2Fnfc-manager.git NFC Bug fixes Improper handling of function return value in LLCP server Wrong data handling in GDBUS helper function Change-Id: Ib6dc5ef8987cc112f527fd0bc71ae7fe7dd87e69 Signed-off-by:Abhijit R D --- diff --git a/common/net_nfc_util_gdbus.c b/common/net_nfc_util_gdbus.c index bc8275e..c375dc3 100644 --- a/common/net_nfc_util_gdbus.c +++ b/common/net_nfc_util_gdbus.c @@ -146,7 +146,7 @@ GVariant *net_nfc_util_gdbus_buffer_to_variant(const uint8_t *buffer, g_variant_builder_init(&builder, G_VARIANT_TYPE("a(y)")); - if (NULL == buffer || length <= 0) + if (buffer && length > 0) { int i; diff --git a/daemon/net_nfc_server_llcp.c b/daemon/net_nfc_server_llcp.c index b5f4072..330f76f 100644 --- a/daemon/net_nfc_server_llcp.c +++ b/daemon/net_nfc_server_llcp.c @@ -1467,7 +1467,7 @@ static gboolean llcp_handle_receive_from(NetNfcGDbusLlcp *llcp, NFC_INFO(">>> REQUEST from [%s]", g_dbus_method_invocation_get_sender(invocation)); - ret == net_nfc_server_gdbus_check_privilege(invocation, smack_privilege, + ret = net_nfc_server_gdbus_check_privilege(invocation, smack_privilege, "nfc-manager::p2p", "w"); /* check privilege and update client context */ @@ -1523,7 +1523,7 @@ static gboolean llcp_handle_close(NetNfcGDbusLlcp *llcp, NFC_INFO(">>> REQUEST from [%s]", g_dbus_method_invocation_get_sender(invocation)); - ret == net_nfc_server_gdbus_check_privilege(invocation, smack_privilege, + ret = net_nfc_server_gdbus_check_privilege(invocation, smack_privilege, "nfc-manager::p2p", "w"); /* check privilege and update client context */ if (false == ret) @@ -1578,7 +1578,7 @@ static gboolean llcp_handle_disconnect(NetNfcGDbusLlcp *llcp, NFC_INFO(">>> REQUEST from [%s]", g_dbus_method_invocation_get_sender(invocation)); - ret == net_nfc_server_gdbus_check_privilege(invocation, smack_privilege, + ret = net_nfc_server_gdbus_check_privilege(invocation, smack_privilege, "nfc-manager::p2p", "w"); /* check privilege and update client context */ if (false == ret)