hostapd: add missing NULL pointer check on radar notification
authorFelix Fietkau <nbd@nbd.name>
Tue, 9 Jan 2024 10:05:45 +0000 (11:05 +0100)
committerRISCi_ATOM <bob@bobcall.me>
Tue, 27 Feb 2024 16:17:50 +0000 (11:17 -0500)
Fixes a race condition that can lead to a hostapd crash

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit d864f68232e910f2c8ab06a66347fc08c257dfcc)

package/network/services/hostapd/src/src/ap/ubus.c

index 693c054177e257e6cbe4670537e8abdde9431db4..61b7c03160396150eba025eb1152f06b76c28db5 100644 (file)
@@ -1907,6 +1907,9 @@ void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequen
        struct hostapd_data *hapd;
        int i;
 
+       if (!ctx)
+               return;
+
        blob_buf_init(&b, 0);
        blobmsg_add_u16(&b, "frequency", frequency);
        blobmsg_add_u16(&b, "width", chan_width);