]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: rtl8188eu: off by one in rtw_set_802_11_add_wep()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 29 Aug 2013 21:45:42 +0000 (00:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Aug 2013 18:46:47 +0000 (11:46 -0700)
"keyid" is used as an offset into the ->dot11DefKey[] array.  The array
has 4 elements.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_ioctl_set.c

index 47fb253fff171a5226fe9ba8521ec365595e5058..193f641bd0deb33290083ceb9ff4d775ef7d205f 100644 (file)
@@ -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;