dhcp6: fix buffer size checking

This commit is contained in:
Yu Watanabe
2018-09-27 23:48:51 +09:00
parent 23976cb928
commit cb1bdeaf56

View File

@@ -844,8 +844,8 @@ static int client_parse_message(
uint8_t *optval;
be32_t iaid_lease;
if (len < offsetof(DHCP6Option, data) ||
len < offsetof(DHCP6Option, data) + be16toh(option->len))
if (len < pos + offsetof(DHCP6Option, data) ||
len < pos + offsetof(DHCP6Option, data) + be16toh(option->len))
return -ENOBUFS;
optcode = be16toh(option->code);