mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 06:21:31 +00:00
mwifiex: pcie: tighten a check in mwifiex_pcie_process_event_ready()
If "evt_len" is 1 then we try to memcpy() negative 3 bytes and it would
cause memory corruption.
Fixes: d930faee14
("mwifiex: add support for Marvell pcie8766 chipset")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
c1003538bf
commit
01eca28428
1 changed files with 2 additions and 1 deletions
|
@ -1881,7 +1881,8 @@ static int mwifiex_pcie_process_event_ready(struct mwifiex_adapter *adapter)
|
|||
mwifiex_dbg(adapter, EVENT,
|
||||
"info: Event length: %d\n", evt_len);
|
||||
|
||||
if ((evt_len > 0) && (evt_len < MAX_EVENT_SIZE))
|
||||
if (evt_len > MWIFIEX_EVENT_HEADER_LEN &&
|
||||
evt_len < MAX_EVENT_SIZE)
|
||||
memcpy(adapter->event_body, skb_cmd->data +
|
||||
MWIFIEX_EVENT_HEADER_LEN, evt_len -
|
||||
MWIFIEX_EVENT_HEADER_LEN);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue