[PATCH] EAP-IKEv2: Fix compilation warning

Ilan Peer ilan.peer
Wed Nov 5 00:50:35 PST 2014


From: Andrei Otcheretianski <andrei.otcheretianski at intel.com>

Fix signed/unsigned comparison compilation warning introduced in
08ef442 "EAP-IKEv2: Fix the payload parser".

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/eap_common/ikev2_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/eap_common/ikev2_common.c b/src/eap_common/ikev2_common.c
index 4b5e665..262d9ab 100644
--- a/src/eap_common/ikev2_common.c
+++ b/src/eap_common/ikev2_common.c
@@ -263,7 +263,7 @@ int ikev2_parse_payloads(struct ikev2_payloads *payloads,
 		}
 		phdr = (const struct ikev2_payload_hdr *) pos;
 		plen = WPA_GET_BE16(phdr->payload_length);
-		if (plen < sizeof(*phdr) || plen > end - pos) {
+		if (plen < sizeof(*phdr) || pos + plen > end) {
 			wpa_printf(MSG_INFO, "IKEV2:   Invalid payload header "
 				   "length %d", plen);
 			return -1;
-- 
1.8.3.2




More information about the Hostap mailing list