diff options
author | Jordan Henderson <jhenderson@hdfgroup.org> | 2019-02-22 16:11:59 (GMT) |
---|---|---|
committer | Jordan Henderson <jhenderson@hdfgroup.org> | 2019-02-22 16:11:59 (GMT) |
commit | 6f103565f945a9a6f5e5e5c1be554814c43392e1 (patch) | |
tree | cc73cee39d35bdef71cbbaf896283941ed795ab0 | |
parent | b78b3ea95ed3297c610186309055ef9c3cbea225 (diff) | |
parent | 2cb70b01eadbed1363ea4418fa1d36e636d9998d (diff) | |
download | hdf5-6f103565f945a9a6f5e5e5c1be554814c43392e1.zip hdf5-6f103565f945a9a6f5e5e5c1be554814c43392e1.tar.gz hdf5-6f103565f945a9a6f5e5e5c1be554814c43392e1.tar.bz2 |
Merge pull request #1572 in HDFFV/hdf5 from ~JHENDERSON/hdf5:hdf5_1_10 to hdf5_1_10
* commit '2cb70b01eadbed1363ea4418fa1d36e636d9998d':
Minor fix in h5str_sprintf for NULL region references
-rw-r--r-- | java/src/jni/h5aImp.c | 2 | ||||
-rw-r--r-- | java/src/jni/h5dImp.c | 2 | ||||
-rw-r--r-- | java/src/jni/h5util.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c index e47515d..eaa356e 100644 --- a/java/src/jni/h5aImp.c +++ b/java/src/jni/h5aImp.c @@ -1389,7 +1389,7 @@ Java_hdf_hdf5lib_H5_H5Aread_1reg_1ref H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Aread_reg_ref: buf length < 0"); } - if (NULL == (ref_data = (hdset_reg_ref_t *) HDmalloc((size_t)n * sizeof(hdset_reg_ref_t)))) + if (NULL == (ref_data = (hdset_reg_ref_t *) HDcalloc(1, (size_t)n * sizeof(hdset_reg_ref_t)))) H5_JNI_FATAL_ERROR(ENVONLY, "H5Aread_reg_ref: failed to allocate read buffer"); if ((status = H5Aread((hid_t)attr_id, (hid_t)mem_type_id, ref_data)) < 0) diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index 55f3d16..5500847 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -1633,7 +1633,7 @@ Java_hdf_hdf5lib_H5_H5Dread_1reg_1ref H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Dread_reg_ref: buf length < 0"); } - if (NULL == (ref_data = (hdset_reg_ref_t *) HDmalloc((size_t)n * sizeof(hdset_reg_ref_t)))) + if (NULL == (ref_data = (hdset_reg_ref_t *) HDcalloc(1, (size_t)n * sizeof(hdset_reg_ref_t)))) H5_JNI_FATAL_ERROR(ENVONLY, "H5Dread_reg_ref: failed to allocate read buffer"); if ((status = H5Dread((hid_t)dataset_id, (hid_t)mem_type_id, (hid_t)mem_space_id, (hid_t)file_space_id, xfer_plist_id, ref_data)) < 0) diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 7857965..5454dce 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -978,7 +978,7 @@ h5str_sprintf case H5T_REFERENCE: { - if (h5str_is_zero(cptr, 99)) { + if (h5str_is_zero(cptr, typeSize)) { if (!h5str_append(out_str, "NULL")) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); break; |