From de88b6724abcb8dc694bc347cf40a79d1d110f0a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 8 Jul 2026 11:45:28 +0200 Subject: [PATCH] check bound before writing in test --- src/tools/perf_replies.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tools/perf_replies.c b/src/tools/perf_replies.c index f9b551fb..eb31e19c 100644 --- a/src/tools/perf_replies.c +++ b/src/tools/perf_replies.c @@ -1978,11 +1978,13 @@ run_mhd (void) } if (1) { - struct MHD_OptionItem option = - { MHD_OPTION_END, 0, NULL }; - opt_arr[opt_count] = option; + struct MHD_OptionItem option = { + MHD_OPTION_END, 0, NULL + }; + if (opt_count >= (sizeof(opt_arr) / sizeof(opt_arr[0]))) abort (); + opt_arr[opt_count] = option; } d = MHD_start_daemon (flags, mhd_port, NULL, NULL, reply_func, NULL, MHD_OPTION_ARRAY, opt_arr, MHD_OPTION_END);