]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
also check that node 0 isn't already in the heap
authorAlan T. DeKok <aland@freeradius.org>
Wed, 20 May 2020 15:29:49 +0000 (11:29 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 20 May 2020 15:29:49 +0000 (11:29 -0400)
src/lib/util/heap.c

index 3676a5b698aa5f6c024d81e0937d6ddddbcd2118..a93ecb2ff57fdf24522522d61cac610f68648bc4 100644 (file)
@@ -124,7 +124,7 @@ int fr_heap_insert(fr_heap_t *hp, void *data)
         *           function
         */
        child = *((int32_t *)(((uint8_t *)data) + hp->offset));
-       if (child > 0) {
+       if ((child > 0) || ((child == 0) && (data == hp->p[0]))) {
                fr_strerror_printf("Node is already in the heap");
                return -1;
        }