From 60b0c18db0a84c331444ddc70619f9c4c3f66cc1 Mon Sep 17 00:00:00 2001 From: rabijl Date: Tue, 19 Mar 2024 19:39:28 +0200 Subject: [PATCH] iperf_api: memset entire malloc in the function iperf_new_test the bitrate_limit_intervals_traffic_bytes array was only memset for the size of the sizeof return type, instead of the entire array. --- src/iperf_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iperf_api.c b/src/iperf_api.c index 4765d4e97..7887235ca 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -2878,7 +2878,7 @@ iperf_new_test() i_errno = IENEWTEST; return NULL; } - memset(test->bitrate_limit_intervals_traffic_bytes, 0, sizeof(sizeof(iperf_size_t) * MAX_INTERVAL)); + memset(test->bitrate_limit_intervals_traffic_bytes, 0, sizeof(iperf_size_t) * MAX_INTERVAL); /* By default all output goes to stdout */ test->outfile = stdout;