]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't do N^2 checks
authorAlan T. DeKok <aland@freeradius.org>
Thu, 21 Apr 2022 17:33:01 +0000 (13:33 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 22 Apr 2022 14:50:15 +0000 (10:50 -0400)
we just need to check if it's a value box,
xlat_is_literal() will check all subsequent nodes, and we don't
want that.

src/lib/unlang/xlat_tokenize.c

index 2d296df3614db9e99bdd183d2c571de5a3fd026e..7ec46063e49e8ff100f7e84901c4c6986e638fcc 100644 (file)
@@ -1624,7 +1624,7 @@ bool xlat_to_string(TALLOC_CTX *ctx, char **str, xlat_exp_t **head)
         *      list until we find a non-literal.
         */
        xlat_exp_foreach(*head, node) {
-               if (!xlat_is_literal(node)) return false;
+               if (node->type != XLAT_BOX) return false;
                len += talloc_array_length(node->fmt) - 1;
        }