diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2012-03-23 04:18:59 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2012-03-23 04:18:59 (GMT) |
commit | 213ab6eb36e398b5d0db55df002875ffcdeb4122 (patch) | |
tree | 526e07f3f28faafd10a517a043347f3fa26e4be7 /hl/fortran/src/H5LTff.f90 | |
parent | 19a6303205d070f62f2579168397579001a38fe5 (diff) | |
download | hdf5-213ab6eb36e398b5d0db55df002875ffcdeb4122.zip hdf5-213ab6eb36e398b5d0db55df002875ffcdeb4122.tar.gz hdf5-213ab6eb36e398b5d0db55df002875ffcdeb4122.tar.bz2 |
[svn-r22129] HDFFV-7777: Fix for removing NULL character from fortran string in h5lt_get_attribute_string_f
Fixed size +1 error in HD5f2cstring
Diffstat (limited to 'hl/fortran/src/H5LTff.f90')
-rwxr-xr-x | hl/fortran/src/H5LTff.f90 | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/hl/fortran/src/H5LTff.f90 b/hl/fortran/src/H5LTff.f90 index 7d53ab7..b384821 100755 --- a/hl/fortran/src/H5LTff.f90 +++ b/hl/fortran/src/H5LTff.f90 @@ -5969,9 +5969,10 @@ CONTAINS CHARACTER(len=*), INTENT(inout) :: buf ! data buffer INTEGER :: namelen ! name length INTEGER :: attrlen ! name length + INTEGER(size_t) :: buf_size ! buf size INTERFACE - INTEGER FUNCTION h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) + INTEGER FUNCTION h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf,buf_size) USE h5global !DEC$IF DEFINED(HDF5F90_WINDOWS) !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTGET_ATTRIBUTE_STRING_C'::h5ltget_attribute_string_c @@ -5984,12 +5985,15 @@ CONTAINS CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute CHARACTER(len=*), INTENT(inout) :: buf ! data buffer + INTEGER(size_t) :: buf_size ! data buffer size END FUNCTION h5ltget_attribute_string_c END INTERFACE namelen = LEN(dset_name) attrlen = LEN(attr_name) - errcode = h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) + buf_size = LEN(buf) + + errcode = h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf,buf_size) END SUBROUTINE h5ltget_attribute_string_f @@ -6360,14 +6364,16 @@ CONTAINS END FUNCTION h5ltpath_valid_c END INTERFACE + ! Initialize + path_valid = .FALSE. + errcode = 0 + check_object_valid_c = 0 IF(check_object_valid) check_object_valid_c = 1 pathlen = LEN(path) status = h5ltpath_valid_c(loc_id, path, pathlen, check_object_valid_c) - path_valid = .FALSE. - errcode = 0 IF(status.EQ.1)THEN path_valid = .TRUE. ELSE IF(status.LT.0)THEN |