diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2005-06-14 21:18:32 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2005-06-14 21:18:32 (GMT) |
commit | 7e7dd03a329f692507203f6cda87fe6f67b86ac7 (patch) | |
tree | c928635641c06760ceb52d9dbdfd3acd62d00130 /src/H5Odtype.c | |
parent | 162b19cd6c1f6c6b14254c60b83bd14b1c11184c (diff) | |
download | hdf5-7e7dd03a329f692507203f6cda87fe6f67b86ac7.zip hdf5-7e7dd03a329f692507203f6cda87fe6f67b86ac7.tar.gz hdf5-7e7dd03a329f692507203f6cda87fe6f67b86ac7.tar.bz2 |
[svn-r10920] Purpose:
Bug fix
Description:
Add check for opaque tags that are too long for file format to handle
currently.
Platforms tested:
FreeBSD 4.11 (sleipnir)
Too minor to require h5commmitest
Diffstat (limited to 'src/H5Odtype.c')
-rw-r--r-- | src/H5Odtype.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5Odtype.c b/src/H5Odtype.c index fe74959..02dac26 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -136,7 +136,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt) /* * Opaque types... */ - z = flags & 0xff; + z = flags & (H5T_OPAQUE_TAG_MAX - 1); assert(0==(z&0x7)); /*must be aligned*/ if (NULL==(dt->shared->u.opaque.tag=H5MM_malloc(z+1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); @@ -585,7 +585,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) * null terminated). */ z = HDstrlen(dt->shared->u.opaque.tag); - aligned = (z+7) & 0xf8; + aligned = (z+7) & (H5T_OPAQUE_TAG_MAX - 8); flags |= aligned; HDmemcpy(*pp, dt->shared->u.opaque.tag, MIN(z,aligned)); for (n=MIN(z,aligned); n<aligned; n++) (*pp)[n] = 0; @@ -1004,7 +1004,7 @@ H5O_dtype_size(const H5F_t *f, const void *mesg) break; case H5T_OPAQUE: - ret_value += (HDstrlen(dt->shared->u.opaque.tag)+7) & 0xf8; + ret_value += (HDstrlen(dt->shared->u.opaque.tag)+7) & (H5T_OPAQUE_TAG_MAX - 8); break; case H5T_FLOAT: |