From: Jouni Malinen Date: Fri, 18 Aug 2023 18:00:45 +0000 (+0300) Subject: Fix hostapd interface cleanup with multiple interfaces X-Git-Tag: hostap_2_11~1037 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd1330b502ffdb076abaef4f16764078dd2e4bf9;p=thirdparty%2Fhostap.git Fix hostapd interface cleanup with multiple interfaces interfaces.iface[i] might be NULL when going through the cleanup of all remaining interfaces at the end of the process termination. The changes for clearing drv_priv in AP MLD cause that cleanup process to crash on dereferencing a NULL pointer. Fix this by explicitly checking that the interface context is available before trying to clear the pointer to driver data. Fixes: 7fa99b3246d1 ("AP: Allow starting multiple interfaces within single MLD") Signed-off-by: Jouni Malinen --- diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 99d10bea9..966030d57 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -401,7 +401,7 @@ static void hostapd_clear_drv_priv(struct hostapd_data *hapd) for (i = 0; i < hapd->iface->interfaces->count; i++) { struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; - if (hapd->iface == iface) + if (hapd->iface == iface || !iface) continue; if (iface->bss && iface->bss[0] &&