staging: prevent an underflow in rtw_check_beacon_data()

* The "len" could be as low as -14 so we should check for negatives.
This commit is contained in:
Christian Bremvåg 2019-08-16 23:05:40 +02:00 committed by GitHub
parent 8f04e62ca7
commit c18b6668eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1931,8 +1931,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
if (!MLME_IS_AP(padapter) && !MLME_IS_MESH(padapter))
return _FAIL;
if (len > MAX_IE_SZ)
if (len < 0 || len > MAX_IE_SZ)
return _FAIL;
pbss_network->IELength = len;