Merge pull request #7885 from pfl/dhcp6_fixes

Minor fixes
This commit is contained in:
Lennart Poettering
2018-01-16 10:44:35 +01:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -358,7 +358,7 @@ int dhcp6_option_parse_ia(DHCP6Option *iaoption, DHCP6IA *ia) {
int r = 0, status;
uint16_t opt;
size_t iaaddr_offset;
uint32_t lt_t1, lt_t2, lt_valid, lt_min = ~0;
uint32_t lt_t1, lt_t2, lt_valid = 0, lt_min = UINT32_MAX;
assert_return(ia, -EINVAL);
assert_return(!ia->addresses, -EINVAL);
+2 -1
View File
@@ -788,7 +788,8 @@ static int client_parse_message(
uint8_t *optval;
be32_t iaid_lease;
if (len < sizeof(DHCP6Option) || len < sizeof(DHCP6Option) + be16toh(option->len))
if (len < offsetof(DHCP6Option, data) ||
len < offsetof(DHCP6Option, data) + be16toh(option->len))
return -ENOBUFS;
optcode = be16toh(option->code);