]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
if we allow %() and %{}, then parse both
authorAlan T. DeKok <aland@freeradius.org>
Tue, 23 Nov 2021 20:46:01 +0000 (15:46 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 23 Nov 2021 20:46:01 +0000 (15:46 -0500)
src/lib/server/tmpl_tokenize.c

index 0ce48970262f5c0f2c299dbfc5abba117d732788..004c586365102f60c0bed0df7e75e75f15ee20bb 100644 (file)
@@ -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;
                                }