From 7496d5800bb2b06bff1c334af1b4cf1fff51c7ae Mon Sep 17 00:00:00 2001 From: jhendersonHDF Date: Mon, 8 Apr 2024 22:17:03 -0500 Subject: [PATCH] Fix use of possibly uninitialized memory in h5repack (#4354) (#4355) --- tools/src/h5repack/h5repack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 6747c25cb30..f571a701771 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -481,7 +481,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ *----------------------------------------------------------------- */ - buf = (void *)malloc((size_t)(nelmts * msize)); + buf = (void *)calloc(1, (size_t)(nelmts * msize)); if (buf == NULL) { H5TOOLS_GOTO_ERROR((-1), "malloc failed"); } /* end if */