Add exception handling for null best_bss 84/285384/1
authorJaehyun Kim <jeik01.kim@samsung.com>
Mon, 12 Dec 2022 01:44:25 +0000 (10:44 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Mon, 12 Dec 2022 01:44:25 +0000 (10:44 +0900)
Change-Id: Idfed20c90265d4e3df4cd2011a46ff52a72f2872
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
gsupplicant/supplicant.c

index 8996d2d..fea0958 100755 (executable)
@@ -1799,8 +1799,8 @@ const unsigned char *g_supplicant_network_get_countrycode(GSupplicantNetwork
 
 dbus_bool_t g_supplicant_network_is_pmf_required(GSupplicantNetwork *network)
 {
-       if (!network)
-               return 0;
+       if (!network || !network->best_bss)
+               return FALSE;
 
        return network->best_bss->pmf_required;
 }
@@ -2646,7 +2646,7 @@ static void update_network_with_best_bss(GSupplicantNetwork *network,
        /*
         * Do not change best BSS if we are connected.
         */
-       if (network->interface->state == G_SUPPLICANT_STATE_COMPLETED)
+       if (network->interface->state == G_SUPPLICANT_STATE_COMPLETED && network->best_bss)
                return;
 
        network->signal = best_bss->signal;