Commit 1c5ebaae authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: vt6655: check too restrictive (off by one)

key_len == MAX_KEY_LEN is valid but we return an error.

Introduced-by: 6b7200fe ('Staging: vt6655: memory corruption in check in wpa_set_wpadev()')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6e28024e
...@@ -202,8 +202,8 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel) ...@@ -202,8 +202,8 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
int uu, ii; int uu, ii;
if (param->u.wpa_key.alg_name > WPA_ALG_CCMP || if (param->u.wpa_key.alg_name > WPA_ALG_CCMP ||
param->u.wpa_key.key_len >= MAX_KEY_LEN || param->u.wpa_key.key_len > MAX_KEY_LEN ||
param->u.wpa_key.seq_len >= MAX_KEY_LEN) param->u.wpa_key.seq_len > MAX_KEY_LEN)
return -EINVAL; return -EINVAL;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "param->u.wpa_key.alg_name = %d \n", param->u.wpa_key.alg_name); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "param->u.wpa_key.alg_name = %d \n", param->u.wpa_key.alg_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment