From: Jaehyun Kim Date: Mon, 8 Jul 2024 09:14:29 +0000 (+0900) Subject: Add invalid user_data checker in signal handler X-Git-Tag: accepted/tizen/unified/20240731.160156~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F96%2F314196%2F1;p=platform%2Fcore%2Fapi%2Fwifi-manager.git Add invalid user_data checker in signal handler 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 --- diff --git a/src/network_signal.c b/src/network_signal.c index 111d9bd..7fa5b34 100644 --- a/src/network_signal.c +++ b/src/network_signal.c @@ -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)