From: Arran Cudbard-Bell Date: Mon, 25 Oct 2021 18:19:24 +0000 (-0400) Subject: Error out if setting tmpl cast failed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d71597eddf2c813821606f1a208bfee7a8162fe;p=thirdparty%2Ffreeradius-server.git Error out if setting tmpl cast failed --- diff --git a/src/lib/server/cf_parse.c b/src/lib/server/cf_parse.c index 9906522911d..b374e48ccbb 100644 --- a/src/lib/server/cf_parse.c +++ b/src/lib/server/cf_parse.c @@ -254,7 +254,10 @@ int cf_pair_parse_value(TALLOC_CTX *ctx, void *out, UNUSED void *base, CONF_ITEM return -1; } - tmpl_cast_set(vpt, cast); + if (tmpl_cast_set(vpt, cast) < 0) { + cf_log_perr(cp, "Failed setting tmpl type"); + return -1; + } /* * Non-blocking xlat's diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 9fb2550a470..ef35afd0512 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -497,7 +497,10 @@ static bool pass2_fixup_cond_map(fr_cond_t *c, CONF_ITEM *ci, fr_dict_t const *d /* * Force the RHS to be cast to whatever the LHS da is. */ - (void) tmpl_cast_set(map->rhs, tmpl_da(map->lhs)->type); + if ((tmpl_cast_set(map->rhs, tmpl_da(map->lhs)->type) < 0) || + (tmpl_enumv_set(map->rhs, tmpl_da(map->rhs)) < 0)) { + cf_log_perr(map->ci, "Failed setting rhs type"); + }; if (map->op != T_OP_CMP_EQ) { cf_log_err(map->ci, "Must use '==' for comparisons with virtual attribute %s", map->lhs->name);