From ede1b9b1dd53caad6dfce8ec7bc4aa7b3dbce62c Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 18 Aug 2020 00:49:09 -0500 Subject: Fix HDFFV-11101 Description Added initialization to local structs in the src function H5MF_settle_raw_data_fsm() and the test function test_bt2_hdr_fd() to prevent the following error in two different occurrences: MemorySanitizer: use-of-uninitialized-value Platforms tested: Linux/64 (jelly) --- src/H5MF.c | 4 ++++ test/dsets.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/H5MF.c b/src/H5MF.c index 1c5c3af..6f1217f 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -2674,6 +2674,10 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) HDassert(f->shared); HDassert(fsm_settled); + /* Initialize structs */ + HDmemset(&fsinfo, 0, sizeof(fsinfo)); + HDmemset(&fs_stat, 0, sizeof(fs_stat)); + /* Only need to settle things if we are persisting the free space info * and allocation/deallocation has occurred. */ diff --git a/test/dsets.c b/test/dsets.c index d72c65b..f7aeb1a 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -11231,6 +11231,9 @@ test_bt2_hdr_fd(const char *env_h5_driver, hid_t fapl) TESTING("Version 2 B-tree chunk index header flush dependencies handled correctly"); + /* Initialize struct */ + HDmemset(&info, 0, sizeof(info)); + /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. */ -- cgit v0.12