Skip to content

Commit

Permalink
Fix Use-of-uninitialized-value in H5FD__sec2_write
Browse files Browse the repository at this point in the history
  • Loading branch information
sashashura committed Aug 10, 2023
1 parent bf68e6e commit 119c853
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/H5FScache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,8 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, void *_thi

/* There may be empty space between entries and chksum */
chksum_image = (uint8_t *)(_image) + len - H5FS_SIZEOF_CHKSUM;
/* Reset the unused space between entries and chksum */
memset(image, 0, len - H5FS_SIZEOF_CHKSUM - ((void*)image - _image));
metadata_chksum = H5_checksum_metadata(_image, (size_t)(chksum_image - (uint8_t *)_image), 0);
/* Metadata checksum */
UINT32ENCODE(chksum_image, metadata_chksum);
Expand Down

0 comments on commit 119c853

Please sign in to comment.