From 972c57f7692b2e362e2665196fcbcf17524e7d01 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 20 Dec 2019 13:23:48 -0600 Subject: HDFFV-10976,-10980 Init obj_type before calling H5Rget_obj_type3 --- java/src/jni/h5rImp.c | 2 +- java/src/jni/h5util.c | 2 +- tools/lib/h5diff_array.c | 4 ++-- tools/lib/h5tools_dump.c | 2 +- tools/lib/h5tools_str.c | 2 +- tools/src/h5ls/h5ls.c | 2 +- tools/testfiles/trefer_obj_delR.ddl | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/java/src/jni/h5rImp.c b/java/src/jni/h5rImp.c index 4ad5d5f..21ee658 100644 --- a/java/src/jni/h5rImp.c +++ b/java/src/jni/h5rImp.c @@ -452,7 +452,7 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Rget_1obj_1type3 (JNIEnv *env, jclass clss, jbyteArray ref, jlong rapl_id) { - H5O_type_t object_info; + H5O_type_t object_info = -1; jboolean isCopy; jbyte *refBuf = NULL; int retVal = -1; diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 5f1bccb..5c82edc 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -1059,7 +1059,7 @@ h5str_sprintf } if (H5Tequal(tid, H5T_STD_REF)) { - H5O_type_t obj_type; /* Object type */ + H5O_type_t obj_type = -1; /* Object type */ H5R_type_t ref_type; /* Reference type */ const H5R_ref_t *ref_vp = (H5R_ref_t *)cptr; diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 637cfa8..ef13da0 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -753,8 +753,8 @@ static hsize_t diff_datum( hid_t region2_id = -1; H5R_ref_t *ref1_buf = (const H5R_ref_t *)_mem1; H5R_ref_t *ref2_buf = (const H5R_ref_t *)_mem2; - H5O_type_t obj1_type; /* Object type */ - H5O_type_t obj2_type; /* Object type */ + H5O_type_t obj1_type = -1; /* Object type */ + H5O_type_t obj2_type = -1; /* Object type */ H5R_type_t ref_type; /* Reference type */ ref_type = H5Rget_type(ref1_buf); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 25707ab..8bedf4b 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -4084,7 +4084,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * } } for(i = 0; i < ndims; i++, datactx.cur_elmt++, elmt_counter++) { - H5O_type_t obj_type; /* Object type */ + H5O_type_t obj_type = -1; /* Object type */ H5R_type_t ref_type; /* Reference type */ H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "reference loop:%d with curr_pos=%ld", i, curr_pos); diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 67f44b1..f734cce 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1093,7 +1093,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, "NULL"); else { if (H5Tequal(type, H5T_STD_REF)) { - H5O_type_t obj_type; /* Object type */ + H5O_type_t obj_type = -1; /* Object type */ H5R_type_t ref_type; /* Reference type */ const H5R_ref_t *ref_vp = (const H5R_ref_t *)vp; diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 7342090..4a9f438 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -1316,7 +1316,7 @@ dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx HDmemset(&buffer, 0, sizeof(h5tools_str_t)); for(i = 0; i < ndims; i++, datactx.cur_elmt++, elmt_counter++) { - H5O_type_t obj_type; /* Object type */ + H5O_type_t obj_type = -1; /* Object type */ H5R_type_t ref_type; /* Reference type */ H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "reference loop:%d with curr_pos=%ld", i, curr_pos); diff --git a/tools/testfiles/trefer_obj_delR.ddl b/tools/testfiles/trefer_obj_delR.ddl index 598998d..fa238a5 100644 --- a/tools/testfiles/trefer_obj_delR.ddl +++ b/tools/testfiles/trefer_obj_delR.ddl @@ -4,7 +4,7 @@ GROUP "/" { DATATYPE H5T_REFERENCE { H5T_STD_REF } DATASPACE SCALAR DATA { - GROUP "trefer_obj_del.h5" + UNKNOWN "trefer_obj_del.h5" } } } -- cgit v0.12