summaryrefslogtreecommitdiffstats
path: root/src/H5R.c
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2012-09-09 19:08:12 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2012-09-09 19:08:12 (GMT)
commit2fae4fbfa629c1bfbeeb31d6b6a403528f1426d9 (patch)
treef2506f983bf829449e7782785869f799f52cd11d /src/H5R.c
parent0824b43ecdde50e93e0e59f1080234d582a63b72 (diff)
downloadhdf5-2fae4fbfa629c1bfbeeb31d6b6a403528f1426d9.zip
hdf5-2fae4fbfa629c1bfbeeb31d6b6a403528f1426d9.tar.gz
hdf5-2fae4fbfa629c1bfbeeb31d6b6a403528f1426d9.tar.bz2
[svn-r22746] Description:
Fix for HDFFV-7959 H5Rdereference should check for default (HADDR_UNDEF) value and not continue processing and return so that ret value can be checked and handled properly. Added fix and test, reviewed: Tested: jam (gnu, intel)
Diffstat (limited to 'src/H5R.c')
-rw-r--r--src/H5R.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5R.c b/src/H5R.c
index d45947b..f34980e 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -568,6 +568,7 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r
{
H5G_loc_t loc; /* Group location */
H5F_t *file = NULL; /* File object */
+ haddr_t addr;
hid_t ret_value;
FUNC_ENTER_API(FAIL)
@@ -582,6 +583,9 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type")
if(_ref == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer")
+ addr = *((const haddr_t*)_ref);
+ if(!H5F_addr_defined(addr))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "undefined reference pointer")
/* Get the file pointer from the entry */
file = loc.oloc->file;