diff options
author | vchoi-hdfgroup <55293060+vchoi-hdfgroup@users.noreply.github.com> | 2022-01-04 23:23:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 23:23:33 (GMT) |
commit | d8ef511b2afac659b7aed3490fedc963b70785d8 (patch) | |
tree | dbd1d5bfc413ad6b49d9ca2179d369a64e6e9df0 /tools/lib/h5tools.c | |
parent | 5d453a6055b994978a3795ee2873bc4170bc576c (diff) | |
parent | a30ca5afcd9f2e35b3a37f74286a6fe264b946f2 (diff) | |
download | hdf5-d8ef511b2afac659b7aed3490fedc963b70785d8.zip hdf5-d8ef511b2afac659b7aed3490fedc963b70785d8.tar.gz hdf5-d8ef511b2afac659b7aed3490fedc963b70785d8.tar.bz2 |
Merge pull request #49 from vchoi-hdfgroup/feature/vfd_swmr
Feature/vfd swmr
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r-- | tools/lib/h5tools.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 5e60941..78e5c48 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1903,15 +1903,21 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t hid_t region_id = H5I_INVALID_HID; hid_t region_space = H5I_INVALID_HID; H5S_sel_type region_type; + H5R_ref_t tref; + + if (size > sizeof(tref)) + H5TOOLS_THROW((-1), "unexpectedly large ref"); + + HDmemset(&tref, 0, sizeof(tref)); for (block_index = 0; block_index < block_nelmts; block_index++) { mem = ((unsigned char *)_mem) + block_index * size; - if ((region_id = H5Ropen_object((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) < 0) + HDmemcpy(&tref, mem, size); + if ((region_id = H5Ropen_object(&tref, H5P_DEFAULT, H5P_DEFAULT)) < 0) H5TOOLS_INFO("H5Ropen_object H5T_STD_REF failed"); else { - if ((region_space = H5Ropen_region((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) >= - 0) { - if (!h5tools_is_zero(mem, H5Tget_size(H5T_STD_REF))) { + if ((region_space = H5Ropen_region(&tref, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if (!h5tools_is_zero(&tref, H5Tget_size(H5T_STD_REF))) { region_type = H5Sget_select_type(region_space); if (region_type == H5S_SEL_POINTS) render_bin_output_region_points(region_space, region_id, stream, |