From: Alan T. DeKok Date: Wed, 15 Jan 2025 16:13:12 +0000 (-0500) Subject: correct type size check. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d332eaa563b6fa06e22c25face33a4f2a13d12d;p=thirdparty%2Ffreeradius-server.git correct type size check. not everything is RADIUS --- diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index bedbe7c2db0..7187951b79f 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -2165,8 +2165,8 @@ ssize_t fr_dict_attr_by_oid_legacy(fr_dict_t const *dict, fr_dict_attr_t const * * @fixme: find the TLV parent, and check it's size */ if (((*parent)->type != FR_TYPE_VENDOR) && ((*parent)->type != FR_TYPE_VSA) && !(*parent)->flags.is_root && - (num > UINT8_MAX)) { - fr_strerror_const("TLV attributes must be between 0..255 inclusive"); + (num > ((uint64_t) 1 << (8 * (*parent)->flags.type_size)))) { + fr_strerror_printf("TLV attributes must be %" PRIu64 " bits or less", ((uint64_t)1 << (8 * (*parent)->flags.type_size))); return 0; }