From: Alan T. DeKok Date: Sun, 18 May 2025 18:39:07 +0000 (-0400) Subject: the first pair returned from the cursor might be structural X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e57112ee8d5973dfe058d769f65629037d49450d;p=thirdparty%2Ffreeradius-server.git the first pair returned from the cursor might be structural 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 --- diff --git a/src/lib/util/pair.c b/src/lib/util/pair.c index 24aae313251..af343c3e961 100644 --- a/src/lib/util/pair.c +++ b/src/lib/util/pair.c @@ -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;