From dc427fe72bcb281a3ff07183da2d4f277f41524e Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 30 Aug 2013 00:45:42 +0300 Subject: [PATCH] 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. Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 47fb253fff17..193f641bd0de 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -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; -- 2.39.5