[svn-r20217] Valgrind indicated error in reading past end of buffer.

Tested: local linux and valgrind
This commit is contained in:
Allen Byrne 2011-03-09 15:31:39 -05:00
parent 5b3223c7c5
commit a76a2e1620

View File

@ -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)