diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2015-08-12 20:11:59 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2015-08-12 20:11:59 (GMT) |
commit | 07106823b4792cdb81bb8b6bf9b56af3e919781b (patch) | |
tree | 0676cf535899c5d525c3a3ce057c56e0f98a95d8 /src/H5Olayout.c | |
parent | 1ba3706640c9280aa1900cbe934a716733131176 (diff) | |
download | hdf5-07106823b4792cdb81bb8b6bf9b56af3e919781b.zip hdf5-07106823b4792cdb81bb8b6bf9b56af3e919781b.tar.gz hdf5-07106823b4792cdb81bb8b6bf9b56af3e919781b.tar.bz2 |
[svn-r27501] Add mapping validity checking to VDS open.
Other minor fixes/cleanup.
Tested: ummon
Diffstat (limited to 'src/H5Olayout.c')
-rw-r--r-- | src/H5Olayout.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/H5Olayout.c b/src/H5Olayout.c index d747512..c462c80 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -299,11 +299,11 @@ H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED * heap_block_p += tmp_size; /* Source selection */ - if(H5S_SELECT_DESERIALIZE(f, &(mesg->storage.u.virt.list[i].source_select), &heap_block_p) < 0) + if(H5S_SELECT_DESERIALIZE(f, &mesg->storage.u.virt.list[i].source_select, &heap_block_p) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "can't decode source space selection") /* Virtual selection */ - if(H5S_SELECT_DESERIALIZE(f, &(mesg->storage.u.virt.list[i].source_dset.virtual_select), &heap_block_p) < 0) + if(H5S_SELECT_DESERIALIZE(f, &mesg->storage.u.virt.list[i].source_dset.virtual_select, &heap_block_p) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "can't decode virtual space selection") /* Parse source file and dataset names for "printf" @@ -340,6 +340,14 @@ H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED * mesg->storage.u.virt.list[i].source_dset.clipped_virtual_select = mesg->storage.u.virt.list[i].source_dset.virtual_select; } /* end if */ + /* Check mapping for validity (do both pre and post + * checks here, since we had to allocate the entry list + * before decoding the selections anyways) */ + if(H5D_virtual_check_mapping_pre(mesg->storage.u.virt.list[i].source_dset.virtual_select, mesg->storage.u.virt.list[i].source_select, H5O_VIRTUAL_STATUS_INVALID) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "invalid mapping selections") + if(H5D_virtual_check_mapping_post(&mesg->storage.u.virt.list[i]) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid mapping entry") + /* Update min_dims */ if(H5D_virtual_update_min_dims(mesg, i) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to update virtual dataset minimum dimensions") |