summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2011-03-09 20:31:39 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2011-03-09 20:31:39 (GMT)
commita76a2e1620ef976d57f36b369e597150317606f9 (patch)
tree3d973b273dc385cf786815b88209bb1eb5ef30fe
parent5b3223c7c569a3a20103c36ea8b38ae744033d2b (diff)
downloadhdf5-a76a2e1620ef976d57f36b369e597150317606f9.zip
hdf5-a76a2e1620ef976d57f36b369e597150317606f9.tar.gz
hdf5-a76a2e1620ef976d57f36b369e597150317606f9.tar.bz2
[svn-r20217] Valgrind indicated error in reading past end of buffer.
Tested: local linux and valgrind
-rw-r--r--tools/h5dump/h5dump.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index cf02a47..5f4842a 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -1463,8 +1463,11 @@ dump_selected_attr(hid_t loc_id, const char *name)
obj_name = (char *)HDmalloc((size_t)j + 2);
/* find the last / */
- while(name[j] != '/' && j >= 0)
+ while(j >= 0) {
+ if (name[j] == '/')
+ break;
j--;
+ }
/* object name */
if(j == -1)