aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_server
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-05-11 15:38:07 (GMT)
committerJouni Malinen <j@w1.fi>2014-05-11 18:24:05 (GMT)
commit0f73c642cc802f02336945cb20f2703efc54fb36 (patch)
treecc64ab970a3f37f3cf03480131f7e30300a85267 /src/eap_server
parentcb4ac38b15efdbdadaf21047f29cf4de177b65f3 (diff)
downloadhostap-0f73c642cc802f02336945cb20f2703efc54fb36.zip
hostap-0f73c642cc802f02336945cb20f2703efc54fb36.tar.gz
hostap-0f73c642cc802f02336945cb20f2703efc54fb36.tar.bz2
EAP-pwd: Fix processing of group setup failure
If invalid group was negotiated, compute_password_element() left some of the data->grp pointer uninitialized and this could result in segmentation fault when deinitializing the EAP method. Fix this by explicitly clearing all the pointer with eap_zalloc(). In addition, speed up EAP failure reporting in this type of error case by indicating that the EAP method execution cannot continue anymore on the peer side instead of waiting for a timeout. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eap_server')
-rw-r--r--src/eap_server/eap_server_pwd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/eap_server/eap_server_pwd.c b/src/eap_server/eap_server_pwd.c
index b0d03d2..5d67c82 100644
--- a/src/eap_server/eap_server_pwd.c
+++ b/src/eap_server/eap_server_pwd.c
@@ -599,7 +599,8 @@ static void eap_pwd_process_id_resp(struct eap_sm *sm,
wpa_hexdump_ascii(MSG_DEBUG, "EAP-PWD (server): peer sent id of",
data->id_peer, data->id_peer_len);
- if ((data->grp = os_malloc(sizeof(EAP_PWD_group))) == NULL) {
+ data->grp = os_zalloc(sizeof(EAP_PWD_group));
+ if (data->grp == NULL) {
wpa_printf(MSG_INFO, "EAP-PWD: failed to allocate memory for "
"group");
return;