Commit d985a584 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: r8188eu: cleanup by using "len" consistently

"*(p + 1)" and "len" are the same thing.  For reviewers who don't know
that, then this code is worrying because we cap "len", but pass
"*(p + 1)" to memcpy().

I have changed the code to use "len" throughout.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 47260313
...@@ -6600,13 +6600,13 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st ...@@ -6600,13 +6600,13 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st
return _FAIL; return _FAIL;
} }
if (*(p + 1)) { if (len) {
if (len > NDIS_802_11_LENGTH_SSID) { if (len > NDIS_802_11_LENGTH_SSID) {
DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len); DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len);
return _FAIL; return _FAIL;
} }
memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1)); memcpy(bssid->Ssid.Ssid, (p + 2), len);
bssid->Ssid.SsidLength = *(p + 1); bssid->Ssid.SsidLength = len;
} else { } else {
bssid->Ssid.SsidLength = 0; bssid->Ssid.SsidLength = 0;
} }
......
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