From d04eba411f0740d93649371605ab0ab9e9abdfb3 Mon Sep 17 00:00:00 2001 From: Rikard Falkeborn Date: Sun, 28 Apr 2019 20:22:55 +0200 Subject: [PATCH] test/bers: Fix sizeof to memset sizeof(fd) is the size of the pointer. Make sure the entire array is set by using the number of elements times the size of the elements. Signed-off-by: Rikard Falkeborn Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Andrei Vagin --- test/others/bers/bers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/others/bers/bers.c b/test/others/bers/bers.c index 0954868ff..90b70c349 100644 --- a/test/others/bers/bers.c +++ b/test/others/bers/bers.c @@ -138,7 +138,7 @@ static int create_files(shared_data_t *shared, int *fd, size_t nr_files) char path[PATH_MAX]; size_t i; - memset(fd, 0xff, sizeof(fd)); + memset(fd, 0xff, sizeof(*fd) * MAX_CHUNK); pr_info("\tCreating %lu files\n", shared->opt_files);