From: Alan T. DeKok Date: Thu, 23 Jan 2025 18:02:29 +0000 (-0500) Subject: suppress casts of string to string X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f64914472c377b722b898a01d8dee585f2e17d2;p=thirdparty%2Ffreeradius-server.git suppress casts of string to string --- diff --git a/src/lib/unlang/xlat_expr.c b/src/lib/unlang/xlat_expr.c index 49e27941129..bd64e7eefa1 100644 --- a/src/lib/unlang/xlat_expr.c +++ b/src/lib/unlang/xlat_expr.c @@ -2663,6 +2663,14 @@ static fr_slen_t tokenize_field(xlat_exp_head_t *head, xlat_exp_t **out, fr_sbuf } } + /* + * Cast a string to a string means "no cast". + */ + if ((cast_type == FR_TYPE_STRING) && (vpt->quote != T_BARE_WORD)) { + tmpl_cast_set(vpt, FR_TYPE_NULL); + cast_type = FR_TYPE_NULL; + } + /* * Push the cast down. *