diff options
author | Choonghwan Lee <clee83@hdfgroup.org> | 2008-12-19 16:22:10 (GMT) |
---|---|---|
committer | Choonghwan Lee <clee83@hdfgroup.org> | 2008-12-19 16:22:10 (GMT) |
commit | c302b9b031b9a52bc7b3f4413adfa71f42e75d79 (patch) | |
tree | 181e6fac66bd8bfcb5f08dfa307f17e9d6660b4a /src/H5Zszip.c | |
parent | 794c05c921d2c016e07eda65dc02d866e40ab0c7 (diff) | |
download | hdf5-c302b9b031b9a52bc7b3f4413adfa71f42e75d79.zip hdf5-c302b9b031b9a52bc7b3f4413adfa71f42e75d79.tar.gz hdf5-c302b9b031b9a52bc7b3f4413adfa71f42e75d79.tar.bz2 |
[svn-r16209] Purpose:
Bug fix (#1357)
Description:
Three filters have not assigned correct value to one value-result argument, "buf_size". N-bit, szip, and scale offset filter have had this problem.
However, I don't think this problem has been making buffer overrun because those filters were informing the caller that the "buf", another value-result argument, is smaller than it actually is. If there was actual buffer overrun, I believe another problem exists although I don't know.
Tested:
jam, smirom, linew
Although all test were passed, I'm concerned about valgrind memcheck error. There can be another miscommunication between filter and the caller.
Diffstat (limited to 'src/H5Zszip.c')
-rw-r--r-- | src/H5Zszip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/H5Zszip.c b/src/H5Zszip.c index 9201a80..b40c028 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -333,7 +333,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], *buf = outbuf; outbuf = NULL; *buf_size = nalloc; - ret_value = nalloc; + ret_value = size_out; } /* Output; compress */ else { @@ -359,7 +359,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], /* Set return values */ *buf = outbuf; outbuf = NULL; - *buf_size = size_out+4; + *buf_size = nbytes+4; ret_value = size_out+4; } |