Skip to content

Commit

Permalink
fix: Updated the type_size check to correctly use what is set in the …
Browse files Browse the repository at this point in the history
…protocol.

Signed-off-by: ethan-thompson <[email protected]>
  • Loading branch information
ethan-thompson committed Jan 15, 2025
1 parent b0c587a commit d6cf39d
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 %llu bits or less", ((uint64_t)1 << (8 * (*parent)->flags.type_size)));
return 0;
}

Expand Down

0 comments on commit d6cf39d

Please sign in to comment.