Allow BSS to return information for AP that uses an invalid WSC IE
[mech_eap.git] / wpa_supplicant / ctrl_iface.c
index 62375e1..feb0e66 100644 (file)
@@ -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 */