]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
the first pair returned from the cursor might be structural
authorAlan T. DeKok <aland@freeradius.org>
Sun, 18 May 2025 18:39:07 +0000 (14:39 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 18 May 2025 18:39:07 +0000 (14:39 -0400)
i.e. if the check for "is leaf" is needed for the subsequent
dcursor operations, then it should be needed for the first one, too

src/lib/util/pair.c

index 24aae3132510984e8e439fcb19fcb912517ca011..af343c3e961b5ca2270ba88d81773372d9022ed2 100644 (file)
@@ -1269,12 +1269,11 @@ static void *_fr_pair_iter_next_dcursor_value(UNUSED fr_dcursor_t *cursor, void
        if (!current) {
                vp = fr_dcursor_current(parent);
                if (!vp) return NULL;
-
-               PAIR_VERIFY(vp);
-               return &vp->data;
+               goto check;
        }
 
        while ((vp = fr_dcursor_next(parent))) {
+       check:
                PAIR_VERIFY(vp);
 
                if (fr_type_is_leaf(vp->vp_type)) return &vp->data;