Skip to content

Commit

Permalink
hostapd: add missing NULL pointer check on radar notification
Browse files Browse the repository at this point in the history
Fixes a race condition that can lead to a hostapd crash

Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
nbd168 committed Jan 9, 2024
1 parent 32d2443 commit d864f68
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions package/network/services/hostapd/src/src/ap/ubus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d864f68

Please sign in to comment.