Add invalid user_data checker in signal handler 96/314196/1
authorJaehyun Kim <jeik01.kim@samsung.com>
Mon, 8 Jul 2024 09:14:29 +0000 (18:14 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Mon, 8 Jul 2024 09:14:29 +0000 (18:14 +0900)
If the time of destroying the wifi handle overlaps
with the time of signal arrival,
there is a possibility that user_data of the wifi handle
that has already been destroyed may be passed in
the signal handler due to timing.
Because this may cause malfunctions,
code to verify user_data has been added.

Change-Id: I3966a3b541275449fbd25dc8f285963148b65fc5
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/network_signal.c

index 111d9bdb435276214c48cc4944163c4e67816c1a..7fa5b345b80b226854ae3e73bd2d086fa8235c94 100644 (file)
@@ -2031,6 +2031,9 @@ static void __net_netconfig_signal_filter(GDBusConnection *conn,
 {
        network_info_s *network_info = (network_info_s *)user_data;
 
+       if (!_wifi_find_network_info_from_handle_list(network_info))
+               return;
+
        if (g_strcmp0(sig, NETCONFIG_SIGNAL_POWERON_COMPLETED) == 0)
                __net_handle_wifi_power_rsp(network_info, param, TRUE);
        else if (g_strcmp0(sig, NETCONFIG_SIGNAL_POWEROFF_COMPLETED) == 0)