From a1e7dd2d3e358ac00e8124277e0cd928977027ff Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 27 Mar 2024 16:17:38 -0700 Subject: [PATCH 1/2] Fix unitialized memory in H5Tconv.c dst_aligned is unitialized and flagged in float --> long double conversions --- config/sanitizer/sanitizers.cmake | 2 +- src/H5Tconv.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/sanitizer/sanitizers.cmake b/config/sanitizer/sanitizers.cmake index bf2aad27d7c..23e54bab6b3 100644 --- a/config/sanitizer/sanitizers.cmake +++ b/config/sanitizer/sanitizers.cmake @@ -84,7 +84,7 @@ if(USE_SANITIZER) set(SANITIZER_MEM_FLAG "-fsanitize=memory") if(USE_SANITIZER MATCHES "([Mm]emory[Ww]ith[Oo]rigins)") message(STATUS "Testing with MemoryWithOrigins sanitizer") - append("-fsanitize-memory-track-origins" SANITIZER_MEM_FLAG) + append("-fsanitize-memory-track-origins=2" SANITIZER_MEM_FLAG) else() message(STATUS "Testing with Memory sanitizer") endif() diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 55b6d7d01da..789ee88eb68 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -839,6 +839,8 @@ ssize_t s_stride, d_stride; /*src and dst strides */ \ size_t safe; /*how many elements are safe to process in each pass */ \ \ + memset(&dst_aligned, 0, sizeof(DT)); \ + \ switch (cdata->command) { \ case H5T_CONV_INIT: \ /* Sanity check and initialize statistics */ \ From 82aea166fa63991102feaf2159d8737dcd60ca40 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:22:37 -0700 Subject: [PATCH 2/2] Update sanitizers.cmake --- config/sanitizer/sanitizers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/sanitizer/sanitizers.cmake b/config/sanitizer/sanitizers.cmake index 23e54bab6b3..bf2aad27d7c 100644 --- a/config/sanitizer/sanitizers.cmake +++ b/config/sanitizer/sanitizers.cmake @@ -84,7 +84,7 @@ if(USE_SANITIZER) set(SANITIZER_MEM_FLAG "-fsanitize=memory") if(USE_SANITIZER MATCHES "([Mm]emory[Ww]ith[Oo]rigins)") message(STATUS "Testing with MemoryWithOrigins sanitizer") - append("-fsanitize-memory-track-origins=2" SANITIZER_MEM_FLAG) + append("-fsanitize-memory-track-origins" SANITIZER_MEM_FLAG) else() message(STATUS "Testing with Memory sanitizer") endif()