From: Felix Fietkau Date: Tue, 9 Jan 2024 10:05:45 +0000 (+0100) Subject: hostapd: add missing NULL pointer check on radar notification X-Git-Tag: v6.1-20240701~76 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3cbdba4d282311d7a69c0ef0e3d001e81c59512e;p=librecmc%2Flibrecmc.git hostapd: add missing NULL pointer check on radar notification Fixes a race condition that can lead to a hostapd crash Signed-off-by: Felix Fietkau (cherry picked from commit d864f68232e910f2c8ab06a66347fc08c257dfcc) --- diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index 693c054177..61b7c03160 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -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);