]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
handle all types of input args
authorAlan T. DeKok <aland@freeradius.org>
Tue, 3 Oct 2023 12:39:38 +0000 (08:39 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 3 Oct 2023 12:39:38 +0000 (08:39 -0400)
src/lib/unlang/xlat_tokenize.c

index 2e6cc0cf9ec00ba8ac725e9c94628defb45bbe74..c43023fc3e87884cec1ce4d7a3139d516d7bc895 100644 (file)
@@ -743,13 +743,20 @@ error:
         *      Validate the arguments.
         */
        if (node->type == XLAT_FUNC) {
-               if (node->call.input_type == XLAT_INPUT_MONO) {
+               switch (node->call.input_type) {
+               case XLAT_INPUT_UNPROCESSED:
+                       break;
+
+               case XLAT_INPUT_MONO:
                        if (xlat_validate_function_mono(node) < 0) goto error;
-               } else {
+                       node->flags.can_purify = (node->call.func->flags.pure && node->call.args->flags.pure) | node->call.args->flags.can_purify;
+                       break;
+
+               case XLAT_INPUT_ARGS:
                        if (xlat_validate_function_args(node) < 0) goto error;
+                       node->flags.can_purify = (node->call.func->flags.pure && node->call.args->flags.pure) | node->call.args->flags.can_purify;
+                       break;
                }
-
-               node->flags.can_purify = (node->call.func->flags.pure && node->call.args->flags.pure) | node->call.args->flags.can_purify;
        }
 
        xlat_exp_insert_tail(head, node);