]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Enforce that [length], if present, must be at the end of the type field (#4457)
authorJames Jones <jejones3141@gmail.com>
Fri, 8 Apr 2022 19:52:08 +0000 (14:52 -0500)
committerGitHub <noreply@github.com>
Fri, 8 Apr 2022 19:52:08 +0000 (15:52 -0400)
src/lib/util/dict_tokenize.c

index 67b013ac538b58f98a184bc38ad2ae36b3ad90e3..c8690c76452c4c89190a220ca82b5820f619d8bc 100644 (file)
@@ -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);