public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 1/5] ap: check that the last band_freq_attrs was set
@ 2024-02-29 18:12 James Prestwood
  2024-02-29 18:12 ` [PATCH 2/5] ap: allow va_end to get called in ap_handshake_event James Prestwood
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: James Prestwood @ 2024-02-29 18:12 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

Static analysis complains that 'last' could be NULL which is true.
This really could only happen if every frequency was disabled which
likely is impossible but in any case, check before dereferencing
the pointer.
---
 src/ap.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ap.c b/src/ap.c
index bce389d3..ee3c4dca 100644
--- a/src/ap.c
+++ b/src/ap.c
@@ -1247,8 +1247,10 @@ static size_t ap_build_country_ie(struct ap_state *ap, uint8_t *out_buf,
 	}
 
 	/* finish final group */
-	*pos++ = nchans;
-	*pos++ = last->tx_power;
+	if (last) {
+		*pos++ = nchans;
+		*pos++ = last->tx_power;
+	}
 
 	len = pos - out_buf - 2;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-29 20:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-29 18:12 [PATCH 1/5] ap: check that the last band_freq_attrs was set James Prestwood
2024-02-29 18:12 ` [PATCH 2/5] ap: allow va_end to get called in ap_handshake_event James Prestwood
2024-02-29 18:12 ` [PATCH 3/5] nl80211util: check l_genl_attr_recurse return in extract_nested James Prestwood
2024-02-29 18:12 ` [PATCH 4/5] ap: verify ATTR_MAC exists in NEW_STATION James Prestwood
2024-02-29 18:12 ` [PATCH 5/5] ap: bail in ap_del_station if AP is going down James Prestwood
2024-02-29 20:38 ` [PATCH 1/5] ap: check that the last band_freq_attrs was set Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox