]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
correct check for tmpl_dcursor_value_box_init()
authorAlan T. DeKok <aland@freeradius.org>
Wed, 14 May 2025 19:18:38 +0000 (15:18 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 14 May 2025 20:15:47 +0000 (16:15 -0400)
-1 is "no cursor", too

src/lib/unlang/xlat_eval.c

index 1d1f83d59db03dee2dbfc3bbd4d3e5c0e26d17ec..b9861576fc38c629e7b616762f22c0c5471695fc 100644 (file)
@@ -534,10 +534,10 @@ check_non_leaf:
                 *      The cursor can return something, nothing (-1), or no list (-2) or no context (-3).  Of
                 *      these, only the last two are actually errors.
                 *
-                *      "no matching pair" is a valid answer, and can be passed to the function.
+                *      "no matching pair" returns _no_ cursor, and not an empty cursor.
                 */
                (void) tmpl_dcursor_value_box_init(&err, vb, request, vpt);
-               if (err < -1) return XLAT_ACTION_FAIL;
+               if (err < 0) return XLAT_ACTION_FAIL;
        }
 
 #undef ESCAPE