nl80211: Remove SIOCGIWRANGE and assume TKIP+CCMP+WPA+WPA2
[wpasupplicant] / src / eap_peer / eap_fast_pac.c
index a052ee1..77893d6 100644 (file)
@@ -555,7 +555,12 @@ static int eap_fast_write_pac(struct eap_sm *sm, const char *pac_file,
                                   "file '%s' for writing", pac_file);
                        return -1;
                }
-               fwrite(buf, 1, len, f);
+               if (fwrite(buf, 1, len, f) != len) {
+                       wpa_printf(MSG_INFO, "EAP-FAST: Failed to write all "
+                                  "PACs into '%s'", pac_file);
+                       fclose(f);
+                       return -1;
+               }
                os_free(buf);
                fclose(f);
        }