]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check limits on the data.
authorAlan T. DeKok <aland@freeradius.org>
Tue, 2 Dec 2025 17:25:29 +0000 (12:25 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 2 Dec 2025 17:40:09 +0000 (12:40 -0500)
to catch the corner case of the encoder returning unrealistic
amounts of data

src/bin/unit_test_attribute.c

index 9294eb427fb18c92dc75b7e438e36ec3574115b6..6797d6d03bf10d76c70c5ccdc94cd59c84eef4ce 100644 (file)
@@ -449,6 +449,8 @@ static inline CC_HINT(nonnull) int dump_fuzzer_data(int fd_dir, char const *text
        char            digest_str[(SHA1_DIGEST_LENGTH * 2) + 1];
        int             file_fd;
 
+       fr_assert(data_len <= COMMAND_OUTPUT_MAX);
+
        fr_sha1_init(&ctx);
        fr_sha1_update(&ctx, (uint8_t const *)text, strlen(text));
        fr_sha1_final(digest, &ctx);