From a7eb4f2bcb8d4b45f5b6ebda71d8756fb202eb1b Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Mon, 12 Dec 2022 10:44:25 +0900 Subject: [PATCH] Add exception handling for null best_bss Change-Id: Idfed20c90265d4e3df4cd2011a46ff52a72f2872 Signed-off-by: Jaehyun Kim --- gsupplicant/supplicant.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index 8996d2d..fea0958 100755 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -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; -- 2.7.4