85d5127f600d2de3fbbf1ef9c4d68cb4a8ae1eb0
[openwrt/staging/xback.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 1 May 2024 18:55:24 +0200
3 Subject: [PATCH] AP: add missing null pointer check in hostapd_free_hapd_data
4
5 When called from wpa_supplicant, iface->interfaces can be NULL
6
7 Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 ---
9
10 --- a/src/ap/hostapd.c
11 +++ b/src/ap/hostapd.c
12 @@ -502,7 +502,7 @@ void hostapd_free_hapd_data(struct hosta
13 struct hapd_interfaces *ifaces = hapd->iface->interfaces;
14 size_t i;
15
16 - for (i = 0; i < ifaces->count; i++) {
17 + for (i = 0; ifaces && i < ifaces->count; i++) {
18 struct hostapd_iface *iface = ifaces->iface[i];
19 size_t j;
20