diff --git a/sys/net/application_layer/dhcpv6/client.c b/sys/net/application_layer/dhcpv6/client.c index cc2d2f7f63..237a86a44a 100644 --- a/sys/net/application_layer/dhcpv6/client.c +++ b/sys/net/application_layer/dhcpv6/client.c @@ -1016,6 +1016,10 @@ static bool _parse_reply(uint8_t *rep, size_t len, uint8_t request_type) default: break; } + /* 0 option is used as an end marker, len can include bogus bytes */ + if (!byteorder_ntohs(opt->type)) { + break; + } } if ((cid == NULL) || (sid == NULL)) { DEBUG("DHCPv6 client: ADVERTISE does not contain either server ID "