From: Jouni Malinen Date: Sat, 29 Aug 2015 20:59:44 +0000 (+0300) Subject: Allow BSS to return information for AP that uses an invalid WSC IE X-Git-Tag: hostap_2_5~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc078be2dd7ff99d03c2edf88a1c226e151d00b0;p=thirdparty%2Fhostap.git Allow BSS to return information for AP that uses an invalid WSC IE Previously, the BSS command returned an error if the WSC IE(s) in scan results could not be parsed. This may be not ideal for all cases, to instead of rejecting the command completely, return all other information apart from the WPS information in such a case. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 62375e13a..feb0e665b 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -4184,9 +4184,10 @@ static int print_bss_info(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, if (mask & WPA_BSS_MASK_WPS_SCAN) { ie = (const u8 *) (bss + 1); ret = wpas_wps_scan_result_text(ie, bss->ie_len, pos, end); - if (ret < 0 || ret >= end - pos) + if (ret >= end - pos) return 0; - pos += ret; + if (ret > 0) + pos += ret; } #endif /* CONFIG_WPS */