diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2011-04-25 16:38:56 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2011-04-25 16:38:56 (GMT) |
commit | 0efc913a6799080c5399a761f603cd80b93e71f0 (patch) | |
tree | 81dcd8d246fb4207a9c49e1904ce91259ec4c919 /tools/lib/h5tools.c | |
parent | fbd98fe9fb6566e00b2401466b3584f325494cfc (diff) | |
download | hdf5-0efc913a6799080c5399a761f603cd80b93e71f0.zip hdf5-0efc913a6799080c5399a761f603cd80b93e71f0.tar.gz hdf5-0efc913a6799080c5399a761f603cd80b93e71f0.tar.bz2 |
[svn-r20624] Albert's test on bp reveals that the dumper had assertion failure when it tried to display empty attribute data. I added
a check for empty attribute in h5dump.c. I also added a check for empty dataset in tools/lib/h5tools.c.
Tested on jam, linew, and amani.
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r-- | tools/lib/h5tools.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 3cce2e5..3d29d39 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -2550,6 +2550,9 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, } } + if(!sm_nbytes) + goto done; + assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/ sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes); @@ -2624,11 +2627,12 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, fputs(OPT(info->line_sep, ""), stream); } + HDfree(sm_buf); + +done: H5Sclose(sm_space); H5Sclose(f_space); - HDfree(sm_buf); - return SUCCEED; } |