From: Dan Carpenter Date: Thu, 29 Aug 2013 21:45:42 +0000 (+0300) Subject: staging: rtl8188eu: off by one in rtw_set_802_11_add_wep() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dc427fe72bcb281a3ff07183da2d4f277f41524e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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;