From: James Jones Date: Fri, 8 Apr 2022 19:52:08 +0000 (-0500) Subject: Enforce that [length], if present, must be at the end of the type field (#4457) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9af34d0f034a1b9511576ebc57319687ce7774c6;p=thirdparty%2Ffreeradius-server.git Enforce that [length], if present, must be at the end of the type field (#4457) --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index 67b013ac53..c8690c7645 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -196,6 +196,10 @@ static int dict_process_type_field(dict_tokenize_ctx_t *ctx, char const *name, f } *q = '\0'; + if (q[1]) { + fr_strerror_const("length, if present, must end type field"); + return -1; + } if (!dict_read_sscanf_i(&length, p + 1)) { fr_strerror_printf("Invalid length for '%s[...]'", name);