Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 784047eb authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

staging: rtl8188eu: prevent an underflow in rtw_check_beacon_data()



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>
parent f78d7669
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -878,7 +878,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
		return _FAIL;


	if (len > MAX_IE_SZ)
	if (len < 0 || len > MAX_IE_SZ)
		return _FAIL;

	pbss_network->IELength = len;