summaryrefslogtreecommitdiffstats
path: root/src/H5Oefl.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2017-12-01 18:41:26 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2017-12-01 18:41:26 (GMT)
commitb8c6b68c35fa2be23ef488a1d81097ff3ed55000 (patch)
treec3429ee577e454526c8704d66a84f0c45b7959a1 /src/H5Oefl.c
parent23a702e7bad93fc4f14eab07678c75d276e2d0ad (diff)
parent60f76980aab92f0e0730170b99a2363acd3c97fa (diff)
downloadhdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.zip
hdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.tar.gz
hdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.tar.bz2
Merge pull request #811 in HDFFV/hdf5 from hdf5_1_8_20 to 1.8/masterhdf5-1_8_20
* commit '60f76980aab92f0e0730170b99a2363acd3c97fa': (108 commits) Update version numbers and remove empty sections in RELEASE.txt. Restore line 1154: C2Cppfunction_map.mht to HTML_EXTRA_FILES. Update version for 1.8.20 release. Fixed documentation warnings HDFFV-10329 Correct LINK INTERFACE and VS20013 compile Switch default build mode from development to production. Increment version string to pre2. Add RELEASE.txt note for HDFFV-10274. (cherry picked from commit f7a7d0a00613cba997212fa8032091629a678797) Initialize hid_t variables in test_Attr_bug9. (cherry picked from commit 97bc393449f3fe02c5992872ab2842e12f611ef0) Fix HDFFV-10274. When deleting all (or almost all) of the messages in an object header chunk, where the total amount deleted was greater than 64K, an error would occur due to an off by one error in the code that handled that case. Fixed this and added a test case. (cherry picked from commit 1b2c2ca9a6a7d7e1fcd5c3302e203f2e2dabf0af) Fix linking of libs Changed file path to relative. iAdd NAG to supported compilers in RELEASE.txt. Add description to RELEASE.txt for HDFFV-10323 Correct issue number Set version to 1.8.20-pre1 Update supported and tested platforms in RELEASE.txt. HDFFV-10321 Merge from 1.8 Incremented lib file .so numbers: revision for all except c++ for code change; current incremented, revision and age set to 0 for c++ due to symbols added and removed. updated issues related to Fortran Incremented lib file .so numbers: revision for all except c++ for dcode change; current incremented, revision and age set to 0 for c++ due to symbols added and removed. ...
Diffstat (limited to 'src/H5Oefl.c')
-rw-r--r--src/H5Oefl.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index 1de3059..218d250 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -67,17 +67,17 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{
/*-------------------------------------------------------------------------
- * Function: H5O_efl_decode
+ * Function: H5O_efl_decode
*
* Purpose: Decode an external file list message and return a pointer to
- * the message (and some other data).
+ * the message (and some other data).
*
- * Return: Success: Ptr to a new message struct.
+ * Return: Success: Ptr to a new message struct.
*
- * Failure: NULL
+ * Failure: NULL
*
* Programmer: Robb Matzke
- * Tuesday, November 25, 1997
+ * Tuesday, November 25, 1997
*
* Modification:
* Raymond Lu
@@ -90,12 +90,12 @@ static void *
H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
{
- H5O_efl_t *mesg = NULL;
- int version;
- const char *s = NULL;
- H5HL_t *heap;
- size_t u; /* Local index variable */
- void *ret_value; /* Return value */
+ H5O_efl_t *mesg = NULL;
+ int version;
+ const char *s = NULL;
+ H5HL_t *heap;
+ size_t u; /* Local index variable */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -104,12 +104,12 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
HDassert(p);
if(NULL == (mesg = (H5O_efl_t *)H5MM_calloc(sizeof(H5O_efl_t))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Version */
version = *p++;
if(version != H5O_EFL_VERSION)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for external file list message")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for external file list message")
/* Reserved */
p += 3;
@@ -141,24 +141,26 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
/* Decode the file list */
mesg->slot = (H5O_efl_entry_t *)H5MM_calloc(mesg->nalloc * sizeof(H5O_efl_entry_t));
if(NULL == mesg->slot)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
if(NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value")
for(u = 0; u < mesg->nused; u++) {
- /* Name */
- H5F_DECODE_LENGTH (f, p, mesg->slot[u].name_offset);
-
- s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset);
- HDassert(s && *s);
- mesg->slot[u].name = H5MM_xstrdup (s);
+ /* Name */
+ H5F_DECODE_LENGTH (f, p, mesg->slot[u].name_offset);
+
+ if((s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset)) == NULL)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "unable to get external file name")
+ if(*s == (char)NULL)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "invalid external file name")
+ mesg->slot[u].name = H5MM_xstrdup (s);
HDassert(mesg->slot[u].name);
- /* File offset */
- H5F_DECODE_LENGTH (f, p, mesg->slot[u].offset);
+ /* File offset */
+ H5F_DECODE_LENGTH (f, p, mesg->slot[u].offset);
- /* Size */
- H5F_DECODE_LENGTH (f, p, mesg->slot[u].size);
+ /* Size */
+ H5F_DECODE_LENGTH (f, p, mesg->slot[u].size);
} /* end for */
if(H5HL_unprotect(heap) < 0)