From: Benjamin Berg Date: Fri, 21 Nov 2025 10:05:52 +0000 (+0100) Subject: AP: Guard against survey list not being initialized X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e76b66c2630ac1de77cd589c7a35cda4914cd288;p=thirdparty%2Fhostap.git AP: Guard against survey list not being initialized Do not try to store survey information in the unusual event that the channels survey_list is not initialized. That should not usually happen, but could, e.g., be the case if the regulatory changes and new channels are added after the ACS scan was started. Signed-off-by: Benjamin Berg Reviewed-by: Andrei Otcheretianski --- diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 162ed9df9..d9bfcae09 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -2244,6 +2244,8 @@ void hostapd_event_get_survey(struct hostapd_iface *iface, continue; if (chan->flag & HOSTAPD_CHAN_DISABLED) continue; + if (!(chan->flag & HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED)) + continue; dl_list_del(&survey->list); dl_list_add_tail(&chan->survey_list, &survey->list);