]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
assert that there's always a format for the node
authorAlan T. DeKok <aland@freeradius.org>
Fri, 16 Sep 2022 00:56:30 +0000 (20:56 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 16 Sep 2022 00:56:30 +0000 (20:56 -0400)
src/lib/unlang/xlat_eval.c

index 22e658ffd7443b7c16e543ca3bdccf9a3da00625..6a94ee0f0af37ff683e0e192ea699c4a014b82f0 100644 (file)
@@ -81,12 +81,15 @@ static char *xlat_fmt_aprint(TALLOC_CTX *ctx, xlat_exp_t const *node)
        switch (node->type) {
        case XLAT_BOX:
        case XLAT_GROUP:
+               fr_assert(node->fmt != NULL);
                return talloc_asprintf(ctx, "%s", node->fmt);
 
        case XLAT_ONE_LETTER:
+               fr_assert(node->fmt != NULL);
                return talloc_asprintf(ctx, "%%%s", node->fmt);
 
        case XLAT_TMPL:
+               fr_assert(node->fmt != NULL);
                return talloc_asprintf(ctx, "%%{%s}", node->fmt);
 
        case XLAT_VIRTUAL: