diff options
Diffstat (limited to 'src/H5Olayout.c')
-rw-r--r-- | src/H5Olayout.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/H5Olayout.c b/src/H5Olayout.c index f6ca222..ee37f3b 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -91,6 +91,11 @@ H5O_layout_decode(H5F_t *f, const uint8 *p, H5O_shared_t __unused__ *sh) /* Dimensionality */ mesg->ndims = *p++; + if (mesg->ndims>H5O_LAYOUT_NDIMS) { + H5MM_xfree(mesg); + HRETURN_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, + "dimensionality is too large"); + } /* Layout class */ mesg->type = *p++; |