Skip to content

Commit

Permalink
Fix unitialized memory in H5Tconv.c
Browse files Browse the repository at this point in the history
dst_aligned is unitialized and flagged in float --> long double
conversions
  • Loading branch information
derobins committed Mar 27, 2024
1 parent 136739b commit a1e7dd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/sanitizer/sanitizers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions src/H5Tconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */ \
Expand Down

0 comments on commit a1e7dd2

Please sign in to comment.