]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
uint8 is bit 2..8, not 2..7
authorAlan T. DeKok <aland@freeradius.org>
Mon, 11 Apr 2022 18:31:09 +0000 (14:31 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 11 Apr 2022 18:31:27 +0000 (14:31 -0400)
src/lib/util/dict_tokenize.c

index c8690c76452c4c89190a220ca82b5820f619d8bc..38076d64a17dd383f2b36094913064634023f124 100644 (file)
@@ -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");