Skip to content

Commit 0c96713

Browse files
Dan Carpentergregkh
authored andcommitted
staging: rtl8188eu: prevent an underflow in rtw_check_beacon_data()
commit 784047eb2d3405a35087af70cba46170c5576b25 upstream. The "len" could be as low as -14 so we should check for negatives. Fixes: 9a7fe54 ("staging: r8188eu: Add source files for new driver - part 1") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e59d911 commit 0c96713

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/staging/rtl8188eu/core/rtw_ap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
894894
return _FAIL;
895895

896896

897-
if (len > MAX_IE_SZ)
897+
if (len < 0 || len > MAX_IE_SZ)
898898
return _FAIL;
899899

900900
pbss_network->IELength = len;

0 commit comments

Comments
 (0)