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)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jan 2024 10:06:24 +0000 (11:06 +0100)
Fixes a race condition that can lead to a hostapd crash

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/src/src/ap/ubus.c

index 6ff2257c329b57857bea0cc6ef7b0be5e615bd72..66eba99901726854b71b99ae1e0421ef430db868 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);