diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2020-06-19 15:53:32 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2020-06-19 15:53:32 (GMT) |
commit | c12da4884f18dda4c9dbc23efd10eb053ec7cf0d (patch) | |
tree | e71fd3771e13aff44085f52d6baa7985a379ae5b /hl/src/H5IM.c | |
parent | d20000ec51d50b66fc1226eeb656b8dc1358f826 (diff) | |
download | hdf5-c12da4884f18dda4c9dbc23efd10eb053ec7cf0d.zip hdf5-c12da4884f18dda4c9dbc23efd10eb053ec7cf0d.tar.gz hdf5-c12da4884f18dda4c9dbc23efd10eb053ec7cf0d.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)
SunOS 5.11 (emu)
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) |