diff options
Diffstat (limited to 'src/H5Sall.c')
-rw-r--r-- | src/H5Sall.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/H5Sall.c b/src/H5Sall.c index d57e6c1..86ab0d8 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -516,7 +516,7 @@ H5S_all_serialize (const H5S_t *space, uint8_t *buf) /* Store the preamble information */ UINT32ENCODE(buf, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ - UINT32ENCODE(buf, (uint32_t)1); /* Store the version number */ + UINT32ENCODE(buf, (uint32_t)H5S_ALL_VERSION_1); /* Store the version number */ UINT32ENCODE(buf, (uint32_t)0); /* Store the un-used padding */ UINT32ENCODE(buf, (uint32_t)0); /* Store the additional information length */ @@ -544,13 +544,23 @@ H5S_all_serialize (const H5S_t *space, uint8_t *buf) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_deserialize(H5S_t *space, const uint8_t H5_ATTR_UNUSED *buf) +H5S_all_deserialize(H5S_t *space, const uint8_t *buf) { + uint32_t version; /* Decoded version */ + uint8_t *p; /* Temporary pointer to buf */ herr_t ret_value; /* return value */ FUNC_ENTER_NOAPI(FAIL) HDassert(space); + HDassert(buf); + + p = buf + 4; + /* Decode version */ + UINT32DECODE(p, version); + + if(version < H5S_ALL_VERSION_1 || version > H5S_ALL_VERSION_LATEST) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for all selection") /* Change to "all" selection */ if((ret_value = H5S_select_all(space, TRUE)) < 0) |