]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Tables no longer null terminated
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 4 Sep 2019 19:51:46 +0000 (15:51 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 4 Sep 2019 20:18:32 +0000 (16:18 -0400)
src/lib/server/xlat_builtin.c

index 4ac6680d17517510735152643754f905c9c98c62..4069d4bc5bb7001b6420771d883c2291af3f52e1 100644 (file)
@@ -465,6 +465,7 @@ static ssize_t xlat_func_debug_attr(UNUSED TALLOC_CTX *ctx, UNUSED char **out, U
             vp = fr_cursor_next(&cursor)) {
                fr_dict_vendor_t const          *vendor;
                fr_table_num_ordered_t const    *type;
+               size_t                          i;
 
                if (vp->da->flags.has_tag) {
                        RIDEBUG2("&%s:%s:%i %s %pV",
@@ -498,12 +499,13 @@ static ssize_t xlat_func_debug_attr(UNUSED TALLOC_CTX *ctx, UNUSED char **out, U
 
                if (!RDEBUG_ENABLED4) continue;
 
-               type = fr_value_box_type_table;
-               while (type->name) {
+               for (i = 0; i < fr_value_box_type_table_len; i++) {
                        int pad;
 
                        fr_value_box_t *dst = NULL;
 
+                       type = &fr_value_box_type_table[i];
+
                        if ((fr_type_t) type->value == vp->vp_type) goto next_type;
 
                        switch (type->value) {
@@ -528,7 +530,6 @@ static ssize_t xlat_func_debug_attr(UNUSED TALLOC_CTX *ctx, UNUSED char **out, U
 
                next_type:
                        talloc_free(dst);
-                       type++;
                }
        }
        REXDENT();