Commit fe947490 authored by Dan Carpenter's avatar Dan Carpenter Committed by Sasha Levin

staging: rtl8188eu: prevent an underflow in rtw_check_beacon_data()

[ Upstream commit 784047eb ]

The "len" could be as low as -14 so we should check for negatives.

Fixes: 9a7fe54d ("staging: r8188eu: Add source files for new driver - part 1")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent 94bfe4f3
...@@ -871,7 +871,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) ...@@ -871,7 +871,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
return _FAIL; return _FAIL;
if (len > MAX_IE_SZ) if (len < 0 || len > MAX_IE_SZ)
return _FAIL; return _FAIL;
pbss_network->IELength = len; pbss_network->IELength = len;
......
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