Skip to content

Commit

Permalink
correct type size check.
Browse files Browse the repository at this point in the history
not everything is RADIUS
  • Loading branch information
alandekok committed Jan 15, 2025
1 parent affdaae commit 4d332ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/util/dict_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4d332ea

Please sign in to comment.