From: Alan T. DeKok Date: Tue, 23 Nov 2021 20:46:01 +0000 (-0500) Subject: if we allow %() and %{}, then parse both X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0db834416;p=thirdparty%2Ffreeradius-server.git if we allow %() and %{}, then parse both --- diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index 0ce48970262..004c5863651 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -4500,11 +4500,15 @@ ssize_t tmpl_preparse(char const **out, size_t *outlen, char const *in, size_t i * expansion, including the enclosing %{} * characters. */ - if (*p == close) { + if ((*p == '}') || (*p == ')')) { + bool match = (*p == close); + p++; depth--; if (depth == 0) { + if (!match) break; + *outlen = p - (*out); return p - in; }