eap_server: Avoid NULL pointer dereference in eap_fast_encrypt_phase2()

If TLS encryption fails, encr may be NULL and that would have resulted
in NULL pointer dereference..

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
This commit is contained in:
Haim Dreyfuss 2015-01-18 20:44:37 -05:00 committed by Jouni Malinen
parent 948d3a8731
commit b760e64276

View file

@ -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 "