EAP-IKEv2: Fix compilation warning

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

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
Andrei Otcheretianski 2014-11-05 03:50:35 -05:00 committed by Jouni Malinen
parent d10792199e
commit 281ff42a01

View file

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