[PATCH 5/7] eap_server: avoid NULL pointer dereference in eap_fast_encrypt_phase2()

Ilan Peer ilan.peer
Sun Jan 18 17:44:37 PST 2015


From: Haim Dreyfuss <haim.dreyfuss at intel.com>

Signed-off-by: Haim Dreyfuss <haim.dreyfuss at intel.com>
---
 src/eap_server/eap_server_fast.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/eap_server/eap_server_fast.c b/src/eap_server/eap_server_fast.c
index 56ac7f4..6745100 100644
--- a/src/eap_server/eap_server_fast.c
+++ b/src/eap_server/eap_server_fast.c
@@ -819,6 +819,9 @@ static int eap_fast_encrypt_phase2(struct eap_sm *sm,
 	encr = eap_server_tls_encrypt(sm, &data->ssl, plain);
 	wpabuf_free(plain);
 
+	if (!encr)
+		return -1;
+
 	if (data->ssl.tls_out && piggyback) {
 		wpa_printf(MSG_DEBUG, "EAP-FAST: Piggyback Phase 2 data "
 			   "(len=%d) with last Phase 1 Message (len=%d "
-- 
1.8.3.2




More information about the Hostap mailing list