Skip to content

Commit

Permalink
dhcp6: make sure we have enough space for the DHCP6 option header
Browse files Browse the repository at this point in the history
  • Loading branch information
poettering committed Oct 19, 2018
1 parent 3941f83 commit 4965374
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libsystemd-network/dhcp6-option.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ int dhcp6_option_append_ia(uint8_t **buf, size_t *buflen, const DHCP6IA *ia) {
return -EINVAL;
}

if (*buflen < len)
if (*buflen < offsetof(DHCP6Option, data) + len)
return -ENOBUFS;

ia_hdr = *buf;
Expand Down

0 comments on commit 4965374

Please sign in to comment.