From 64ea2f5d49fcf76bcd023427d9c9333342ded286 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Tue, 8 Mar 2022 16:44:42 -0500 Subject: [PATCH] ensure that string/octet arrays are marked as "length=uint16" --- src/protocols/dhcpv6/base.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/protocols/dhcpv6/base.c b/src/protocols/dhcpv6/base.c index 744c8678ed3..600d103f680 100644 --- a/src/protocols/dhcpv6/base.c +++ b/src/protocols/dhcpv6/base.c @@ -1028,6 +1028,11 @@ static bool attr_valid(UNUSED fr_dict_t *dict, UNUSED fr_dict_attr_t const *pare */ if (flags->array && ((type == FR_TYPE_STRING) || (type == FR_TYPE_OCTETS))) { flags->is_known_width = true; + + if (flags->extra && (flags->subtype != FLAG_LENGTH_UINT16)) { + fr_strerror_const("string/octets arrays require the 'length=uint16' flag"); + return false; + } } /* -- 2.47.3