]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
suppress casts of string to string
authorAlan T. DeKok <aland@freeradius.org>
Thu, 23 Jan 2025 18:02:29 +0000 (13:02 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 23 Jan 2025 18:02:29 +0000 (13:02 -0500)
src/lib/unlang/xlat_expr.c

index 49e27941129db06f97e798da811ff0431351ce60..bd64e7eefa1b0fb61d386841c28775c8ea7dc4c4 100644 (file)
@@ -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.
                 *