mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 10:18:21 -05:00
privsep: Fix scan result fetching with Beacon frame IEs
wpa_priv did not yet support Beacon frame IEs (res->beacon_ie_len) which resulted in invalid scan data being accepted in driver_privsep.c. Add support for res->beacon_ie_len and also fix the validation step to take this new variable length field into account. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
0771e912ae
commit
d3c43e5855
@ -173,7 +173,11 @@ wpa_driver_privsep_get_scan_results2(void *priv)
|
||||
break;
|
||||
os_memcpy(r, pos, len);
|
||||
pos += len;
|
||||
if (sizeof(*r) + r->ie_len > (size_t) len) {
|
||||
if (sizeof(*r) + r->ie_len + r->beacon_ie_len > (size_t) len) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"privsep: Invalid scan result len (%d + %d + %d > %d)",
|
||||
(int) sizeof(*r), (int) r->ie_len,
|
||||
(int) r->beacon_ie_len, len);
|
||||
os_free(r);
|
||||
break;
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ static void wpa_priv_get_scan_results2(struct wpa_priv_interface *iface,
|
||||
|
||||
for (i = 0; i < res->num; i++) {
|
||||
struct wpa_scan_res *r = res->res[i];
|
||||
val = sizeof(*r) + r->ie_len;
|
||||
val = sizeof(*r) + r->ie_len + r->beacon_ie_len;
|
||||
if (end - pos < (int) sizeof(int) + val)
|
||||
break;
|
||||
os_memcpy(pos, &val, sizeof(int));
|
||||
|
Loading…
Reference in New Issue
Block a user