diff --git a/feeds/ipq807x_v5.4/hostapd/src/src/ap/ubus.c b/feeds/ipq807x_v5.4/hostapd/src/src/ap/ubus.c index bff01c172..468d210da 100644 --- a/feeds/ipq807x_v5.4/hostapd/src/src/ap/ubus.c +++ b/feeds/ipq807x_v5.4/hostapd/src/src/ap/ubus.c @@ -1958,6 +1958,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); diff --git a/feeds/ipq95xx/hostapd/src/src/ap/ubus.c b/feeds/ipq95xx/hostapd/src/src/ap/ubus.c index 8f0f8a16b..3ef443d43 100644 --- a/feeds/ipq95xx/hostapd/src/src/ap/ubus.c +++ b/feeds/ipq95xx/hostapd/src/src/ap/ubus.c @@ -1892,6 +1892,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); diff --git a/feeds/wifi-ax/hostapd/src/src/ap/ubus.c b/feeds/wifi-ax/hostapd/src/src/ap/ubus.c index cd152fd1a..db904f804 100644 --- a/feeds/wifi-ax/hostapd/src/src/ap/ubus.c +++ b/feeds/wifi-ax/hostapd/src/src/ap/ubus.c @@ -1958,6 +1958,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); diff --git a/patches/0073-hostapd-add-missing-NULL-pointer-check-on-radar-noti.patch b/patches/0073-hostapd-add-missing-NULL-pointer-check-on-radar-noti.patch new file mode 100644 index 000000000..8ec0666a0 --- /dev/null +++ b/patches/0073-hostapd-add-missing-NULL-pointer-check-on-radar-noti.patch @@ -0,0 +1,27 @@ +From 20bf17b6bb9c40a14db5ed9744c3362afe4a67d8 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 9 Jan 2024 12:36:01 +0100 +Subject: [PATCH] hostapd: add missing NULL pointer check on radar notification + +Signed-off-by: John Crispin +--- + package/network/services/hostapd/src/src/ap/ubus.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c +index 52f83c50f7..54361ea460 100644 +--- a/package/network/services/hostapd/src/src/ap/ubus.c ++++ b/package/network/services/hostapd/src/src/ap/ubus.c +@@ -2125,6 +2125,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); +-- +2.34.1 +