Validate network_info before processing async dbus method call reply 04/248404/2
authorNishant Chaprana <n.chaprana@samsung.com>
Thu, 26 Nov 2020 05:23:30 +0000 (10:53 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Thu, 26 Nov 2020 05:55:25 +0000 (11:25 +0530)
Change-Id: Iea759afbfa9f70582fb722b2b5ba7ce9a587f55d
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
include/wifi_internal.h
packaging/capi-network-wifi-manager.spec
src/network_dbus.c
src/wifi_internal.c

index d556d53..2154717 100755 (executable)
@@ -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,
index 3c60183..02aa421 100755 (executable)
@@ -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
index 728bde9..ba7aa36 100755 (executable)
@@ -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);
index 36eb4fb..34c5cae 100755 (executable)
@@ -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;