From 1c344bb6c448523ed3197e9b1f9d5436f3aee4be Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 30 Jul 2007 15:56:39 -0500 Subject: [svn-r14028] Description: Add more error checking for reading a shared message (i.e. named datatype) that might not be understandable (probably from being stored with a later version of the library). Tested on: FreeBSD/32 6.2 (duty) w/compatibility tests --- src/H5Oshared.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/H5Oshared.c b/src/H5Oshared.c index 0f1da5e..867248f 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -104,9 +104,10 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_shared_t *shared, const H5O_msg_cla HDassert(type); /* Get the shared message */ - ret_value = H5O_read_real(&(shared->ent), type, 0, mesg, dxpl_id); + if(NULL == (ret_value = H5O_read_real(&(shared->ent), type, 0, mesg, dxpl_id))) + HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to retrieve shared message") if(type->set_share && (type->set_share)(f, ret_value, shared) < 0) - HGOTO_ERROR (H5E_OHDR, H5E_CANTINIT, NULL, "unable to set sharing information") + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to set sharing information") done: FUNC_LEAVE_NOAPI(ret_value) -- cgit v0.12