Commit 4ca5218e authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 401c90e5
...@@ -655,6 +655,9 @@ bool KeybSetDefaultKey ( ...@@ -655,6 +655,9 @@ bool KeybSetDefaultKey (
return (false); return (false);
} }
if (uKeyLength > MAX_KEY_LEN)
return false;
pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = true; pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = true;
for(ii=0;ii<ETH_ALEN;ii++) for(ii=0;ii<ETH_ALEN;ii++)
pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID[ii] = 0xFF; pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID[ii] = 0xFF;
......
...@@ -684,6 +684,9 @@ BOOL KeybSetDefaultKey( ...@@ -684,6 +684,9 @@ BOOL KeybSetDefaultKey(
return (FALSE); return (FALSE);
} }
if (uKeyLength > MAX_KEY_LEN)
return false;
pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = TRUE; pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = TRUE;
for (ii = 0; ii < ETH_ALEN; ii++) for (ii = 0; ii < ETH_ALEN; ii++)
pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID[ii] = 0xFF; pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID[ii] = 0xFF;
......
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