diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-03-29 09:43:54 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-10 09:17:34 -0700 |
commit | 4ca5218e3939685c2325fc0a0a1ac8150272c93f (patch) | |
tree | fb56eb7e2f5d12f91c31923294815eb7476eb414 /drivers/staging/vt6655 | |
parent | 401c90e56c48b1c642507a8bec91b7ae21f1156e (diff) | |
download | blackbird-op-linux-4ca5218e3939685c2325fc0a0a1ac8150272c93f.tar.gz blackbird-op-linux-4ca5218e3939685c2325fc0a0a1ac8150272c93f.zip |
Staging: vt6655-6: check keysize before memcpy()
We need to check the we don't copy too much memory. This comes from a
copy_from_user() in the ioctl.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6655')
-rw-r--r-- | drivers/staging/vt6655/key.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/vt6655/key.c b/drivers/staging/vt6655/key.c index 0ff8d7bbf2a7..774b0d4a7e06 100644 --- a/drivers/staging/vt6655/key.c +++ b/drivers/staging/vt6655/key.c @@ -655,6 +655,9 @@ bool KeybSetDefaultKey ( return (false); } + if (uKeyLength > MAX_KEY_LEN) + return false; + pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = true; for(ii=0;ii<ETH_ALEN;ii++) pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID[ii] = 0xFF; |