diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2020-07-05 21:15:28 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2020-07-05 21:15:28 (GMT) |
commit | bf3ef96e9d5a28e824d7e89b5af590b61f530944 (patch) | |
tree | 4f92d9bd0dc4430e586a1ce7ab937059a0229a8c /hl/src/H5IM.c | |
parent | 37f6de1b3037a2b7a569c2edb08f58f8ba323af0 (diff) | |
download | hdf5-bf3ef96e9d5a28e824d7e89b5af590b61f530944.zip hdf5-bf3ef96e9d5a28e824d7e89b5af590b61f530944.tar.gz hdf5-bf3ef96e9d5a28e824d7e89b5af590b61f530944.tar.bz2 |
Fix HDFFV-10591
Description:
h52gif produced a segfault when a buffer overflow occurred because
the data size was corrupted and became very large. This commit added
a check on the data size against the buffer size to prevent the segfault.
It also added error reporting to h52gif to display an error message
instead of silently exiting when the failure occurred.
Platforms tested:
Linux/64 (jelly)
Diffstat (limited to 'hl/src/H5IM.c')
-rw-r--r-- | hl/src/H5IM.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 2a7ed9b..6f7414b 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -274,7 +274,8 @@ herr_t H5IMget_image_info( hid_t loc_id, return -1; /* Try to find the attribute "INTERLACE_MODE" on the >>image<< dataset */ - has_attr = H5LT_find_attribute(did, "INTERLACE_MODE"); + if ((has_attr = H5LT_find_attribute(did, "INTERLACE_MODE")) < 0) + goto out; /* It exists, get it */ if(has_attr == 1) |