From a76a2e1620ef976d57f36b369e597150317606f9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 9 Mar 2011 15:31:39 -0500 Subject: [svn-r20217] Valgrind indicated error in reading past end of buffer. Tested: local linux and valgrind --- tools/h5dump/h5dump.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- cgit v0.12