From: Arran Cudbard-Bell Date: Thu, 15 Dec 2022 02:27:10 +0000 (-0600) Subject: Catch uses of uninitialised fields X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff89e9d513d095820df2ba1631952ab18ba153f0;p=thirdparty%2Ffreeradius-server.git Catch uses of uninitialised fields --- diff --git a/src/lib/util/pair.c b/src/lib/util/pair.c index 8c508172524..8dde9aebe29 100644 --- a/src/lib/util/pair.c +++ b/src/lib/util/pair.c @@ -183,6 +183,14 @@ static inline CC_HINT(always_inline) void pair_init_from_da(fr_pair_t *vp, fr_di if (likely(fr_type_is_leaf(da->type))) { fr_value_box_init(&vp->data, da->type, da, false); } else { +#ifndef NDEBUG + /* + * Make it very obvious if we failed + * to initialise something. + */ + memset(&vp->data, 0xff, sizeof(vp->data)); +#endif + /* * Hack around const issues... */