]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add more size, and assert that max is initialized
authorAlan T. DeKok <aland@freeradius.org>
Thu, 31 Jul 2025 17:21:39 +0000 (13:21 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 1 Aug 2025 11:05:54 +0000 (07:05 -0400)
src/lib/util/value.c

index b5199757734f1747a46e7a59c4bcda6b3403793b..0f0443f7e6298430a84355eed58bff0e37b95e63 100644 (file)
@@ -131,6 +131,8 @@ static size_t const fr_value_box_network_sizes[FR_TYPE_MAX + 1][2] = {
        [FR_TYPE_INT32]                         = {4, 4},
        [FR_TYPE_INT64]                         = {8, 8},
 
+       [FR_TYPE_SIZE]                          = {8, 8},
+
        [FR_TYPE_FLOAT32]                       = {4, 4},
        [FR_TYPE_FLOAT64]                       = {8, 8},
 
@@ -1859,6 +1861,8 @@ ssize_t fr_value_box_from_network(TALLOC_CTX *ctx,
        min = network_min_size(type);
        max = network_max_size(type);
 
+       fr_assert(max > 0);
+
        if (len < min) {
                fr_strerror_printf("Got truncated value parsing type \"%s\". "
                                   "Expected length >= %zu bytes, got %zu bytes",