[PATCH 5/7] wpa_supplicant: fix null dereference in eap_fast_parse_end()

Ilan Peer ilan.peer
Mon Feb 10 02:55:07 PST 2014


From: Eytan Lifshitz <eytan.lifshitz at intel.com>

in eap_fast_parse_end(), pos might be NULL if the line doesn't
contain '='.

Signed-hostap: Eytan Lifshitz <eytan.lifshitz at intel.com>
---
 src/eap_peer/eap_fast_pac.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/eap_peer/eap_fast_pac.c b/src/eap_peer/eap_fast_pac.c
index 8c480b9..21d6098 100644
--- a/src/eap_peer/eap_fast_pac.c
+++ b/src/eap_peer/eap_fast_pac.c
@@ -330,6 +330,8 @@ static const char * eap_fast_parse_end(struct eap_fast_pac **pac_root,
 static const char * eap_fast_parse_pac_type(struct eap_fast_pac *pac,
 					    char *pos)
 {
+	if (!pos)
+		return "Cannot parse pac type";
 	pac->pac_type = atoi(pos);
 	if (pac->pac_type != PAC_TYPE_TUNNEL_PAC &&
 	    pac->pac_type != PAC_TYPE_USER_AUTHORIZATION &&
-- 
1.7.10.4




More information about the Hostap mailing list