From: Nick Porter Date: Fri, 29 Nov 2024 13:39:55 +0000 (+0000) Subject: Pacify Coverity (CID #1634587) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=286ff45de1c8ff7a855f118ce0f35490e28bdbc4;p=thirdparty%2Ffreeradius-server.git Pacify Coverity (CID #1634587) 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. --- diff --git a/src/lib/unlang/xlat_tokenize.c b/src/lib/unlang/xlat_tokenize.c index 2923a071c7c..879181c3620 100644 --- a/src/lib/unlang/xlat_tokenize.c +++ b/src/lib/unlang/xlat_tokenize.c @@ -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));