diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-04-22 13:47:23 +0300 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2017-06-26 05:02:21 +0300 |
commit | fe947490181055dcd0cc61ad26c84302aadb8645 (patch) | |
tree | 810b00ccfcd1908e3c18b1d0953c613cbfb693fc | |
parent | 94bfe4f31f46435ecb6f834cd090241860dd0d0c (diff) | |
download | linux-fe947490181055dcd0cc61ad26c84302aadb8645.tar.xz |
staging: rtl8188eu: prevent an underflow in rtw_check_beacon_data()
[ Upstream commit 784047eb2d3405a35087af70cba46170c5576b25 ]
The "len" could be as low as -14 so we should check for negatives.
Fixes: 9a7fe54ddc3a ("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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_ap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c index e65ee6e858a8..82d46b6334fb 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ap.c +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c @@ -871,7 +871,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; |