Skip to content

Commit

Permalink
Staging: vt6655: memory corruption in check in wpa_set_wpadev()
Browse files Browse the repository at this point in the history
The original code left it up to the user to decide how much data to
copy, but that doesn't work with a fixed size array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Oct 19, 2011
1 parent 4535743 commit 6b7200f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/staging/vt6655/wpactl.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ int wpa_set_wpadev(PSDevice pDevice, int val)
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.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);
Expand Down

0 comments on commit 6b7200f

Please sign in to comment.