summaryrefslogtreecommitdiffstats
path: root/src/H5Gent.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2018-03-13 00:56:54 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2018-03-13 00:56:54 (GMT)
commitb877534a330a201e3b5c51d97daa8e01a5c1cd3a (patch)
tree0823bdc3769590346d483f089ed158538fd131ee /src/H5Gent.c
parent26109aad51393d2a9e6d3a667a0a3ddf8b5e874e (diff)
downloadhdf5-b877534a330a201e3b5c51d97daa8e01a5c1cd3a.zip
hdf5-b877534a330a201e3b5c51d97daa8e01a5c1cd3a.tar.gz
hdf5-b877534a330a201e3b5c51d97daa8e01a5c1cd3a.tar.bz2
Added a fix for HDFFV-10358.
Diffstat (limited to 'src/H5Gent.c')
-rw-r--r--src/H5Gent.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/H5Gent.c b/src/H5Gent.c
index 7987850..6e076ae 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -91,7 +91,7 @@ H5FL_BLK_EXTERN(str_buf);
*-------------------------------------------------------------------------
*/
herr_t
-H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsigned n)
+H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, const uint8_t *p_end, H5G_entry_t *ent, unsigned n)
{
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
@@ -104,9 +104,12 @@ H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsign
HDassert(ent);
/* decode entries */
- for(u = 0; u < n; u++)
+ for(u = 0; u < n; u++) {
+ if(*pp > p_end)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "ran off the end of the image buffer")
if(H5G_ent_decode(f, pp, ent + u) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode")
+ }
done:
FUNC_LEAVE_NOAPI(ret_value)