staging: vt6655: check too restrictive (off by one)
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 3 Jan 2014 20:59:09 +0000 (23:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jan 2014 19:02:13 +0000 (11:02 -0800)
key_len == MAX_KEY_LEN is valid but we return an error.

Introduced-by: 6b7200fe0a59 ('Staging: vt6655: memory corruption in check in wpa_set_wpadev()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/wpactl.c

index ee83704e440139d2c0d713512ef3e864584eec20..d43efb85f4d3feea41e32b9e7473501406c32995 100644 (file)
@@ -202,8 +202,8 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
        int uu, ii;
 
        if (param->u.wpa_key.alg_name > WPA_ALG_CCMP ||
-           param->u.wpa_key.key_len >= MAX_KEY_LEN ||
-           param->u.wpa_key.seq_len >= MAX_KEY_LEN)
+           param->u.wpa_key.key_len > MAX_KEY_LEN ||
+           param->u.wpa_key.seq_len > MAX_KEY_LEN)
                return -EINVAL;
 
        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "param->u.wpa_key.alg_name = %d \n", param->u.wpa_key.alg_name);