⬢ DragonFlyBSD Kernel Audit
DF-3471 / fix.diff
← back to finding ↓ download raw
--- a/sys/netproto/802_11/wlan/ieee80211_ratectl.c	2026-06-29 12:51:19.000000000 +0000
+++ b/sys/netproto/802_11/wlan/ieee80211_ratectl.c	2026-10-26 03:32:28.598643362 +0000
@@ -57,7 +57,7 @@
 void
 ieee80211_ratectl_register(int type, const struct ieee80211_ratectl *ratectl)
 {
-	if (type >= IEEE80211_RATECTL_MAX)
+	if (type < 0 || type >= IEEE80211_RATECTL_MAX)
 		return;
 	ratectls[type] = ratectl;
 }
@@ -65,7 +65,7 @@
 void
 ieee80211_ratectl_unregister(int type)
 {
-	if (type >= IEEE80211_RATECTL_MAX)
+	if (type < 0 || type >= IEEE80211_RATECTL_MAX)
 		return;
 	ratectls[type] = NULL;
 }
@@ -137,7 +137,7 @@
 void
 ieee80211_ratectl_set(struct ieee80211vap *vap, int type)
 {
-	if (type >= IEEE80211_RATECTL_MAX)
+	if (type < 0 || type >= IEEE80211_RATECTL_MAX)
 		return;
 	if (ratectls[type] == NULL) {
 		ieee80211_load_module(ratectl_modnames[type]);