]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move assertion to run-time error
authorAlan T. DeKok <aland@freeradius.org>
Tue, 3 Sep 2024 16:53:37 +0000 (12:53 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 3 Sep 2024 19:05:26 +0000 (15:05 -0400)
so that we don't crash when the admin mis-types something

src/lib/server/tmpl_eval.c

index b4ffe37cb1e3ba5161d132ca0a0620d3ea241c59..dc5acbbdfb18bf860c14b685f2773ff17521eecd 100644 (file)
@@ -1172,7 +1172,10 @@ int tmpl_eval_pair(TALLOC_CTX *ctx, fr_value_box_list_t *out, request_t *request
                break;
 
        default:
-               fr_assert(fr_type_is_leaf(vp->vp_type));
+               if (!fr_type_is_leaf(vp->vp_type)) {
+                       fr_strerror_const("Invalid data type for evaluation");
+                       goto fail;
+               }
 
                value = fr_value_box_alloc(ctx, vp->data.type, vp->da);
                if (!value) goto oom;