From: Jouni Malinen Date: Sun, 3 May 2015 08:18:31 +0000 (+0300) Subject: EAP-SIM/AKA: Explicitly check for header to include Reserved field X-Git-Tag: hostap_2_5~767 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff4a6d4382d399a6bdfad24d75105b8fc1481387;p=thirdparty%2Fhostap.git EAP-SIM/AKA: Explicitly check for header to include Reserved field This was previously checked as part of the eap_sim_parse_attr() processing, but it is easier to review the code if there is an additional explicit check for confirming that the Reserved field is present since the pos variable is advanced beyond it. Signed-off-by: Jouni Malinen --- diff --git a/src/eap_peer/eap_aka.c b/src/eap_peer/eap_aka.c index 0662ae738..dc9e8cc34 100644 --- a/src/eap_peer/eap_aka.c +++ b/src/eap_peer/eap_aka.c @@ -1296,7 +1296,7 @@ static struct wpabuf * eap_aka_process(struct eap_sm *sm, void *priv, pos = eap_hdr_validate(EAP_VENDOR_IETF, data->eap_method, reqData, &len); - if (pos == NULL || len < 1) { + if (pos == NULL || len < 3) { ret->ignore = TRUE; return NULL; } diff --git a/src/eap_peer/eap_sim.c b/src/eap_peer/eap_sim.c index bd06df78d..99a2816ce 100644 --- a/src/eap_peer/eap_sim.c +++ b/src/eap_peer/eap_sim.c @@ -1042,7 +1042,7 @@ static struct wpabuf * eap_sim_process(struct eap_sm *sm, void *priv, } pos = eap_hdr_validate(EAP_VENDOR_IETF, EAP_TYPE_SIM, reqData, &len); - if (pos == NULL || len < 1) { + if (pos == NULL || len < 3) { ret->ignore = TRUE; return NULL; }