]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Pacify Coverity (CID #1634587)
authorNick Porter <nick@portercomputing.co.uk>
Fri, 29 Nov 2024 13:39:55 +0000 (13:39 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 29 Nov 2024 13:39:55 +0000 (13:39 +0000)
Coverity doesn't see that the fixed arguments aways have variadic set,
so thought the loop would walk beyond the end of the argument list.

src/lib/unlang/xlat_tokenize.c

index 2923a071c7c89a584b9d30881a63333d33c97af6..879181c36203d21029fb135b22078e0f11541b56 100644 (file)
@@ -1287,8 +1287,9 @@ fr_slen_t xlat_tokenize_argv(TALLOC_CTX *ctx, xlat_exp_head_t **out, fr_sbuff_t
        if (xlat && xlat->args) {
                arg_start = arg = xlat->args;   /* Track the arguments as we parse */
        } else {
-               static xlat_arg_parser_t        default_arg = { .variadic = XLAT_ARG_VARIADIC_EMPTY_SQUASH };
-               arg_start = arg = &default_arg;
+               static xlat_arg_parser_t const  default_arg[] = { { .variadic = XLAT_ARG_VARIADIC_EMPTY_SQUASH },
+                                                                 XLAT_ARG_PARSER_TERMINATOR };
+               arg_start = arg = &default_arg[0];
        }
 
        MEM(head = xlat_exp_head_alloc(ctx));