From: Alan T. DeKok Date: Thu, 21 Apr 2022 17:33:01 +0000 (-0400) Subject: don't do N^2 checks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf2175db3b9ac8eaea03ed5e6a52178de4dc0d75;p=thirdparty%2Ffreeradius-server.git don't do N^2 checks 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. --- diff --git a/src/lib/unlang/xlat_tokenize.c b/src/lib/unlang/xlat_tokenize.c index 2d296df3614..7ec46063e49 100644 --- a/src/lib/unlang/xlat_tokenize.c +++ b/src/lib/unlang/xlat_tokenize.c @@ -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; }