From: Alan T. DeKok Date: Mon, 11 Apr 2022 18:31:09 +0000 (-0400) Subject: uint8 is bit 2..8, not 2..7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2b8b4dbe0c87080613dc0ef6e74a208a2ab861b;p=thirdparty%2Ffreeradius-server.git uint8 is bit 2..8, not 2..7 --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index c8690c76452..38076d64a17 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -237,13 +237,13 @@ static int dict_process_type_field(dict_tokenize_ctx_t *ctx, char const *name, f if (length == 1) { type = FR_TYPE_BOOL; - } else if (length < 8) { + } else if (length <= 8) { type = FR_TYPE_UINT8; - } else if (length < 16) { + } else if (length <= 16) { type = FR_TYPE_UINT16; - } else if (length < 32) { + } else if (length <= 32) { type = FR_TYPE_UINT32; - } else if (length < 56) { /* for laziness in encode / decode */ + } else if (length <= 56) { /* for laziness in encode / decode */ type = FR_TYPE_UINT64; } else { fr_strerror_const("Invalid length for bit field");