Minor fix in h5str_sprintf for NULL region references

This commit is contained in:
Jordan Henderson 2019-02-21 22:28:17 -06:00
parent 342cad2a3d
commit 8a4371f69a
3 changed files with 3 additions and 3 deletions

View File

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

View File

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

View File

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