Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.10 Merge] Fix valgrind warning about write of uninitialized bytes in ScaleOffse… #3459

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/H5Zscaleoffset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,9 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu
}
/* output; compress */
else {
size_t used_bytes;
size_t unused_bytes;

HDassert(nbytes == d_nelmts * p.size);

/* before preprocess, convert to memory endianness order if needed */
Expand Down Expand Up @@ -1347,7 +1350,10 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu
/* (Looks like an error in the original determination of how many
* bytes would be needed for parameters. - QAK, 2010/08/19)
*/
HDmemset(outbuf + 13, 0, (size_t)8);
used_bytes = 4 + 1 + sizeof(unsigned long long);
assert(used_bytes <= size_out);
unused_bytes = size_out - used_bytes;
HDmemset(outbuf + 13, 0, unused_bytes);

/* special case: minbits equal to full precision */
if (minbits == p.size * 8) {
Expand Down