From: Jouni Malinen Date: Fri, 13 Mar 2009 15:53:13 +0000 (+0200) Subject: Fix segmentation fault on EAP-TTLS phase 2 EAP method init failure X-Git-Tag: hostap_0_7_0~451 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99bff8430fd59dc77db56642a40ef8e6c430db28;p=thirdparty%2Fhostap.git Fix segmentation fault on EAP-TTLS phase 2 EAP method init failure This is based on a patch and report by Masashi Honma . The issue is more generic than just TNC, though, since failure to initialize any phase 2 EAP method can result in NULL dereference. --- diff --git a/src/eap_server/eap_ttls.c b/src/eap_server/eap_ttls.c index b097ab2ea..d04f4f68f 100644 --- a/src/eap_server/eap_ttls.c +++ b/src/eap_server/eap_ttls.c @@ -954,7 +954,7 @@ static int eap_ttls_phase2_eap_init(struct eap_sm *sm, sm->init_phase2 = 1; data->phase2_priv = data->phase2_method->init(sm); sm->init_phase2 = 0; - return 0; + return data->phase2_priv == NULL ? -1 : 0; }