From 8c44461faecc2563410fe7ee6401b5d04cc0a4a5 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Thu, 31 Jul 2025 13:21:39 -0400 Subject: [PATCH] add more size, and assert that max is initialized --- src/lib/util/value.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/util/value.c b/src/lib/util/value.c index b519975773..0f0443f7e6 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -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", -- 2.47.2