]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MBO: Fix possible NULL pointer dereference on candidate handling
authorPradeep Reddy Potteti <c_ppotte@qti.qualcomm.com>
Fri, 28 Apr 2017 10:52:08 +0000 (16:22 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 3 May 2017 15:30:31 +0000 (18:30 +0300)
If the driver provides input on MBO transition candidate handling, the
target value in get_mbo_transition_candidate() can be NULL if the driver
provided BSSID is not found in the wpa_supplicant BSS table. And later
it would be dereferenced. Fix this by adding an explicit check before
dereferencing the pointer.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/wnm_sta.c

index f17a8dc83878c9d8e4d25c65af88c936cbbf8ee0..7339ed26d2771968434a6632b77fd10dc2703e81 100644 (file)
@@ -581,8 +581,9 @@ get_mbo_transition_candidate(struct wpa_supplicant *wpa_s,
                for (i = 0; i < info->num; i++) {
                        target = wpa_bss_get_bssid(wpa_s,
                                                   info->candidates[i].bssid);
-                       if (target->level <
-                           wpa_s->conf->disassoc_imminent_rssi_threshold)
+                       if (target &&
+                           (target->level <
+                            wpa_s->conf->disassoc_imminent_rssi_threshold))
                                continue;
                        goto end;
                }