提交 4ca5218e 编写于 作者: D Dan Carpenter 提交者: 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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 401c90e5
......@@ -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;
......
......@@ -684,6 +684,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册