Skip to contentSkip to conversation

staging: rtl8188eu: off by one in rtw_set_802_11_add_wep()

PATCH In review Dan Carpenter 1 participant 1 message Aug 29, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 staging: rtl8188eu: off by one in rtw_set_802_11_add_wep()

"keyid" is used as an offset into the ->dot11DefKey[] array. The array has 4 elements.

drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +1 -1
index 9e12774..5fab477 100644
@@ -566,7 +566,7 @@ _func_enter_;
 
 	keyid = wep->KeyIndex & 0x3fffffff;
 
-	if (keyid > 4) {
+	if (keyid >= 4) {
 		RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("MgntActrtw_set_802_11_add_wep:keyid>4 =>fail\n"));
 		ret = false;
 		goto exit;