]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add assert to match commit b5c9a3cd25121
authorAlan T. DeKok <aland@freeradius.org>
Thu, 15 Dec 2022 15:13:36 +0000 (10:13 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 21 Dec 2022 17:49:17 +0000 (12:49 -0500)
src/lib/util/dlist.h

index bf4b5b8975500e8f0a2686419adfa5967ec3afdf..4a97e40c1ee0f97670a6ea8a542195ff614187c9 100644 (file)
@@ -260,6 +260,8 @@ static inline CC_HINT(nonnull) void fr_dlist_entry_replace(fr_dlist_t *entry, fr
  */
 static inline void _fr_dlist_init(fr_dlist_head_t *list_head, size_t offset, char const *type)
 {
+       fr_assert(offset < (1 << 20)); /* list_head->offset is `unsigned int`, and 1G structs are stupid. */
+
        fr_dlist_entry_init(&list_head->entry);
        list_head->offset = offset;
        list_head->type = type;