From 3984fb0582083c5c0f511ed3a33eb17908eccb08 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 14 Jun 2024 14:43:39 +0200 Subject: [PATCH] hostapd: fix crash on interface setup failure Add a missing NULL pointer check when deleting beacons Signed-off-by: Felix Fietkau --- ...crash-when-adding-an-interface-fails.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 package/network/services/hostapd/patches/060-nl80211-fix-crash-when-adding-an-interface-fails.patch diff --git a/package/network/services/hostapd/patches/060-nl80211-fix-crash-when-adding-an-interface-fails.patch b/package/network/services/hostapd/patches/060-nl80211-fix-crash-when-adding-an-interface-fails.patch new file mode 100644 index 0000000000..1df2eff387 --- /dev/null +++ b/package/network/services/hostapd/patches/060-nl80211-fix-crash-when-adding-an-interface-fails.patch @@ -0,0 +1,21 @@ +From: Felix Fietkau +Date: Fri, 14 Jun 2024 14:41:16 +0200 +Subject: [PATCH] nl80211: fix crash when adding an interface fails + +When adding an interface fails early, the bss link is still NULL. +Avoid crashing on deleting beacons. + +Signed-off-by: Felix Fietkau +--- + +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -3071,7 +3071,7 @@ static int wpa_driver_nl80211_del_beacon + struct wpa_driver_nl80211_data *drv = bss->drv; + struct i802_link *link = nl80211_get_link(bss, link_id); + +- if (!link->beacon_set) ++ if (!link || !link->beacon_set) + return 0; + + wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)", -- 2.30.2