]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't verify data.enumv for structural types
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 7 Oct 2021 02:43:26 +0000 (21:43 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 7 Oct 2021 02:43:26 +0000 (21:43 -0500)
src/lib/util/pair.c

index 7f075e199d342d7744f973c07bbf2b822eb34931..65fce525d06242355e9b767ea53151971b72282d 100644 (file)
@@ -261,6 +261,8 @@ fr_pair_t *fr_pair_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t const *da)
                break;
        }
 
+       VP_VERIFY(vp);
+
        return vp;
 }
 
@@ -2325,7 +2327,7 @@ void fr_pair_verify(char const *file, int line, fr_pair_t const *vp)
        }
 
        fr_dict_attr_verify(file, line, vp->da);
-       if (vp->data.enumv) fr_dict_attr_verify(file, line, vp->data.enumv);
+
        /*
         *      Each pair should be in one state, either inserted
         *      into a list or not...
@@ -2425,6 +2427,16 @@ void fr_pair_verify(char const *file, int line, fr_pair_t const *vp)
                return;
        }
 
+       /*
+        *      Only perform this check when we're sure
+        *      that this attribute isn't structural.
+        *
+        *      If it's a structural type then the
+        *      space used by the fr_value_box_t gets
+        *      used by the pair list.
+        */
+       if (vp->data.enumv) fr_dict_attr_verify(file, line, vp->data.enumv);
+
        if (vp->vp_ptr) switch (vp->vp_type) {
        case FR_TYPE_OCTETS:
        {