summaryrefslogtreecommitdiffstats
path: root/src/H5Gent.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2017-08-22 06:36:20 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2017-08-22 06:36:20 (GMT)
commitb07eb6efd06bbe44562fe6c93e826f40a56c01d2 (patch)
treee757d29d387275cd8fb8351f5148634277bb176d /src/H5Gent.c
parenta6d5bf1a86250cc660cd1ed420eeda6940792be5 (diff)
downloadhdf5-b07eb6efd06bbe44562fe6c93e826f40a56c01d2.zip
hdf5-b07eb6efd06bbe44562fe6c93e826f40a56c01d2.tar.gz
hdf5-b07eb6efd06bbe44562fe6c93e826f40a56c01d2.tar.bz2
Fix for HDFFV-10216 segfault in H5G_node_cmp3 with corrupt h5 file
Fix H5HL_offset_into() to return error when offset exceeds heap data block size. Also fix other places that call this routine to detect error return.
Diffstat (limited to 'src/H5Gent.c')
-rw-r--r--src/H5Gent.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/H5Gent.c b/src/H5Gent.c
index b781fae..7987850 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -541,8 +541,8 @@ herr_t
H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth,
const H5HL_t *heap)
{
- const char *lval = NULL;
- int nested_indent, nested_fwidth;
+ const char *lval = NULL;
+ int nested_indent, nested_fwidth;
FUNC_ENTER_PACKAGE_NOERR
@@ -551,14 +551,14 @@ H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth,
nested_fwidth = MAX(0, fwidth - 3);
HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
- "Name offset into private heap:",
- (unsigned long) (ent->name_off));
+ "Name offset into private heap:",
+ (unsigned long) (ent->name_off));
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
- "Object header address:", ent->header);
+ "Object header address:", ent->header);
HDfprintf(stream, "%*s%-*s ", indent, "", fwidth,
- "Cache info type:");
+ "Cache info type:");
switch(ent->type) {
case H5G_NOTHING_CACHED:
HDfprintf(stream, "Nothing Cached\n");
@@ -581,13 +581,13 @@ H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth,
HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth,
"Cached information:");
HDfprintf(stream, "%*s%-*s %lu\n", nested_indent, "", nested_fwidth,
- "Link value offset:",
- (unsigned long)(ent->cache.slink.lval_offset));
+ "Link value offset:",
+ (unsigned long)(ent->cache.slink.lval_offset));
if(heap) {
lval = (const char *)H5HL_offset_into(heap, ent->cache.slink.lval_offset);
HDfprintf(stream, "%*s%-*s %s\n", nested_indent, "", nested_fwidth,
- "Link value:",
- lval);
+ "Link value:",
+ (lval == NULL) ? "" : lval);
} /* end if */
else
HDfprintf(stream, "%*s%-*s\n", nested_indent, "", nested_fwidth, "Warning: Invalid heap address given, name not displayed!");