From: Alan T. DeKok Date: Thu, 18 Dec 2025 16:57:24 +0000 (+0100) Subject: tweak "cast to same type" to not do bad things X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab6475039d7535a6abda27c0124fdbe6502c211f;p=thirdparty%2Ffreeradius-server.git tweak "cast to same type" to not do bad things if no enumv is passed in, it shouldn't forcibly nuke the input enumv. This patch makes it easier to deal with FR_TYPE_ATTR --- diff --git a/src/lib/util/value.c b/src/lib/util/value.c index 8032fca00c3..2f86f21b57a 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -3763,7 +3763,7 @@ int fr_value_box_cast(TALLOC_CTX *ctx, fr_value_box_t *dst, ret = fr_value_box_copy(ctx, dst, src); if (ret < 0) return ret; - dst->enumv = dst_enumv; + if (dst_enumv) dst->enumv = dst_enumv; return ret; }