OSDN Git Service

Accumulative patch from commit dc013f1e37df3462085cf01a13f0c432f146ad7a
[android-x86/external-wpa_supplicant_8.git] / src / eap_peer / eap_fast_pac.c
index fc987da..8c480b9 100644 (file)
@@ -422,8 +422,12 @@ int eap_fast_load_pac(struct eap_sm *sm, struct eap_fast_pac **pac_root,
        if (eap_fast_init_pac_data(sm, pac_file, &rc) < 0)
                return 0;
 
-       if (eap_fast_read_line(&rc, &pos) < 0 ||
-           os_strcmp(pac_file_hdr, rc.buf) != 0)
+       if (eap_fast_read_line(&rc, &pos) < 0) {
+               /* empty file - assume it is fine to overwrite */
+               eap_fast_deinit_pac_data(&rc);
+               return 0;
+       }
+       if (os_strcmp(pac_file_hdr, rc.buf) != 0)
                err = "Unrecognized header line";
 
        while (!err && eap_fast_read_line(&rc, &pos) == 0) {