Skip to content

Commit

Permalink
dhcp6: fix buffer size checking
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwata committed Sep 27, 2018
1 parent 23976cb commit cb1bdea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libsystemd-network/sd-dhcp6-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cb1bdea

Please sign in to comment.