From: Nishant Chaprana Date: Thu, 26 Nov 2020 05:23:30 +0000 (+0530) Subject: Validate network_info before processing async dbus method call reply X-Git-Tag: submit/tizen/20201127.052752~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F248404%2F2;p=platform%2Fcore%2Fapi%2Fwifi-manager.git Validate network_info before processing async dbus method call reply Change-Id: Iea759afbfa9f70582fb722b2b5ba7ce9a587f55d Signed-off-by: Nishant Chaprana --- diff --git a/include/wifi_internal.h b/include/wifi_internal.h index d556d53..2154717 100755 --- a/include/wifi_internal.h +++ b/include/wifi_internal.h @@ -320,6 +320,7 @@ void _wifi_add_to_handle_list(wifi_manager_h *wifi); void _wifi_remove_from_handle_list(wifi_manager_h wifi); int _wifi_length_from_handle_list(void); bool _wifi_find_from_handle_list(wifi_manager_h wifi); +bool _wifi_find_network_info_from_handle_list(network_info_s *network_info); void _wifi_clear_profile_list(void); int _wifi_activate(wifi_manager_h wifi, wifi_manager_activated_cb callback, diff --git a/packaging/capi-network-wifi-manager.spec b/packaging/capi-network-wifi-manager.spec index 3c60183..02aa421 100755 --- a/packaging/capi-network-wifi-manager.spec +++ b/packaging/capi-network-wifi-manager.spec @@ -1,6 +1,6 @@ Name: capi-network-wifi-manager Summary: Network Wi-Fi library in TIZEN C API -Version: 1.3.4 +Version: 1.3.5 Release: 1 Group: System/Network License: Apache-2.0 diff --git a/src/network_dbus.c b/src/network_dbus.c index 728bde9..ba7aa36 100755 --- a/src/network_dbus.c +++ b/src/network_dbus.c @@ -264,9 +264,9 @@ static void __net_open_connection_reply(GObject *source_object, GAsyncResult *re net_event_info_s *event_data = NULL; net_profile_info_s prof_info; network_info_s *network_info = (network_info_s *)user_data; - network_request_table_s *request_table = network_info->request_table; - network_request_table_s *open_info = &request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION]; - network_request_table_s *wps_info = &request_table[NETWORK_REQUEST_TYPE_ENROLL_WPS]; + network_request_table_s *request_table; + network_request_table_s *open_info; + network_request_table_s *wps_info; WIFI_LOG(WIFI_INFO, "__net_open_connection_reply() called"); @@ -286,6 +286,11 @@ static void __net_open_connection_reply(GObject *source_object, GAsyncResult *re return; } + if (false == _wifi_find_network_info_from_handle_list(network_info)) { + __NETWORK_FUNC_EXIT__; + return; + } + WIFI_LOG(WIFI_ERROR, "Connection open failed[%d]", Error); event_data = g_try_malloc0(sizeof(net_event_info_s)); @@ -294,6 +299,10 @@ static void __net_open_connection_reply(GObject *source_object, GAsyncResult *re return; } + request_table = network_info->request_table; + open_info = &request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION]; + wps_info = &request_table[NETWORK_REQUEST_TYPE_ENROLL_WPS]; + if (open_info->flag == TRUE) { g_strlcpy(event_data->ProfileName, open_info->ProfileName, NET_PROFILE_NAME_LEN_MAX + 1); diff --git a/src/wifi_internal.c b/src/wifi_internal.c index 36eb4fb..34c5cae 100755 --- a/src/wifi_internal.c +++ b/src/wifi_internal.c @@ -1530,7 +1530,7 @@ bool _wifi_find_from_handle_list(wifi_manager_h wifi) return false; } -static bool _wifi_find_network_info_from_handle_list(network_info_s *network_info) +bool _wifi_find_network_info_from_handle_list(network_info_s *network_info) { GSList *list = NULL;