aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-02-03 22:35:38 (GMT)
committerJouni Malinen <j@w1.fi>2008-02-03 22:35:38 (GMT)
commit5c04c4fd860c984a962e0e0a0935ef86663f7d9b (patch)
tree73d27a0dbb9e0c7fa90a04415f7169bc4a675988
parent3bfc9d27066aa2307a691fa26de1e3f46ed581c2 (diff)
downloadhostap-history-5c04c4fd860c984a962e0e0a0935ef86663f7d9b.zip
hostap-history-5c04c4fd860c984a962e0e0a0935ef86663f7d9b.tar.gz
hostap-history-5c04c4fd860c984a962e0e0a0935ef86663f7d9b.tar.bz2
Do not call Phase 2 method buildReq() if initialization failed
EAP-FAST with EAP-SIM as an inner method could tricker a NULL pointer dereference if EAP-SIM DB was not configured. Avoid this by not calling buildReq() for the Phase 2 method if initialization failed.
-rw-r--r--src/eap_server/eap_fast.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/eap_server/eap_fast.c b/src/eap_server/eap_fast.c
index 54507c5..01341a4 100644
--- a/src/eap_server/eap_fast.c
+++ b/src/eap_server/eap_fast.c
@@ -667,6 +667,11 @@ static struct wpabuf * eap_fast_build_phase2_req(struct eap_sm *sm,
{
struct wpabuf *req;
+ if (data->phase2_priv == NULL) {
+ wpa_printf(MSG_DEBUG, "EAP-FAST: Phase 2 method not "
+ "initialized");
+ return NULL;
+ }
req = data->phase2_method->buildReq(sm, data->phase2_priv, id);
if (req == NULL)
return NULL;