]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
stop if we get to a sibling structure
authorAlan T. DeKok <aland@freeradius.org>
Tue, 19 Nov 2019 19:45:48 +0000 (14:45 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 19 Nov 2019 19:45:48 +0000 (14:45 -0500)
i.e. if we want to encode 2 of the same structs in a row

src/lib/util/struct.c

index 07a603a2b2e13c2bf46d907d450f92187c6854ff..306ed6d2aee020c415f31375b0b79507665db007 100644 (file)
@@ -586,7 +586,7 @@ ssize_t fr_struct_to_network(uint8_t *out, size_t outlen,
                 *      Nothing more to do, or we've done all of the
                 *      entries in this structure, stop.
                 */
-               if (!vp || (vp->da->parent != parent)) {
+               if (!vp || (vp->da->parent != parent) || (vp->da->attr < child_num)) {
                        break;
                }
        }