diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index 4dc4d123d..618e5243d 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -790,7 +790,8 @@ static void wpa_config_write_cred(FILE *f, struct wpa_cred *cred) const char *name; name = eap_get_name(cred->eap_method[0].vendor, cred->eap_method[0].method); - fprintf(f, "\teap=%s\n", name); + if (name) + fprintf(f, "\teap=%s\n", name); } if (cred->phase1) fprintf(f, "\tphase1=\"%s\"\n", cred->phase1);