mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
ctrl_iface: BSS command to skip info items if parsing fails
In some cases parsing of the mesh scan info for a BSS or the P2P scan info can fail. One reason can be that the Beacon/Probe Response frame contained malformed length vendor IEs which are not parsed when adding to the BSS table. Instead of skipping the whole BSS of the BSS command, just skip the part that failed to parse. Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
This commit is contained in:
parent
51435515fb
commit
3b208346ec
@ -4298,8 +4298,9 @@ static int print_bss_info(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
|
|||||||
if (mask & WPA_BSS_MASK_P2P_SCAN) {
|
if (mask & WPA_BSS_MASK_P2P_SCAN) {
|
||||||
ie = (const u8 *) (bss + 1);
|
ie = (const u8 *) (bss + 1);
|
||||||
ret = wpas_p2p_scan_result_text(ie, bss->ie_len, pos, end);
|
ret = wpas_p2p_scan_result_text(ie, bss->ie_len, pos, end);
|
||||||
if (ret < 0 || ret >= end - pos)
|
if (ret >= end - pos)
|
||||||
return 0;
|
return 0;
|
||||||
|
if (ret > 0)
|
||||||
pos += ret;
|
pos += ret;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_P2P */
|
#endif /* CONFIG_P2P */
|
||||||
@ -4381,8 +4382,9 @@ static int print_bss_info(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
|
|||||||
if (mask & WPA_BSS_MASK_MESH_SCAN) {
|
if (mask & WPA_BSS_MASK_MESH_SCAN) {
|
||||||
ie = (const u8 *) (bss + 1);
|
ie = (const u8 *) (bss + 1);
|
||||||
ret = wpas_mesh_scan_result_text(ie, bss->ie_len, pos, end);
|
ret = wpas_mesh_scan_result_text(ie, bss->ie_len, pos, end);
|
||||||
if (ret < 0 || ret >= end - pos)
|
if (ret >= end - pos)
|
||||||
return 0;
|
return 0;
|
||||||
|
if (ret > 0)
|
||||||
pos += ret;
|
pos += ret;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_MESH */
|
#endif /* CONFIG_MESH */
|
||||||
|
Loading…
Reference in New Issue
Block a user