summaryrefslogtreecommitdiffstats
path: root/tools/h4toh5sds.c
diff options
context:
space:
mode:
authorMuQun Yang <ymuqun@hdfgroup.org>2000-11-29 19:05:47 (GMT)
committerMuQun Yang <ymuqun@hdfgroup.org>2000-11-29 19:05:47 (GMT)
commitc5cd064a8842be7d5369bd93f762d17f80ed44a9 (patch)
treebe5e5737070e12355613e26dec89e6545c3d8a18 /tools/h4toh5sds.c
parentb3f6b6ffdd77685d0ac5d114c4f853aa57e1eb4f (diff)
downloadhdf5-c5cd064a8842be7d5369bd93f762d17f80ed44a9.zip
hdf5-c5cd064a8842be7d5369bd93f762d17f80ed44a9.tar.gz
hdf5-c5cd064a8842be7d5369bd93f762d17f80ed44a9.tar.bz2
[svn-r3023]
Purpose: bug fix (zeroing memory for memory allocating for the name of dimensional list) Description: At modi4, test failed due to garbage read for name of dimensional list. Solution: zeroing out memory before writing the name. Platforms tested: modi4, eirene(Linux)
Diffstat (limited to 'tools/h4toh5sds.c')
-rw-r--r--tools/h4toh5sds.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/h4toh5sds.c b/tools/h4toh5sds.c
index 6c07724..3781e63 100644
--- a/tools/h4toh5sds.c
+++ b/tools/h4toh5sds.c
@@ -717,6 +717,11 @@ int sdsdim_to_h5dataset(int32 sds_id,int32 sds_rank,hid_t sh5dset,
char h5dimpath_name[MAX_DIM_NAME];
herr_t ret;
+
+ /*zero out memory for h5sdsdim_allname and h5dimpath_name */
+ h4toh5_ZeroMemory(h5sdsdim_allname,(MAX_VAR_DIMS*MAX_DIM_NAME)*sizeof(char));
+ h4toh5_ZeroMemory(h5dimpath_name,MAX_DIM_NAME*sizeof(char));
+
/*check whether the sds is created with unlimited dimension. */
if(SDgetchunkinfo(sds_id,&c_def_out, &c_flags)== FAIL) {
@@ -781,7 +786,8 @@ int sdsdim_to_h5dataset(int32 sds_id,int32 sds_rank,hid_t sh5dset,
/* here we should add some comments for fakedim0--name. It seems that
hdf4(netcdf) will use unique fake dimension name, fakedim + unique
number, so check_sdsdim will never be 1 if the dimension name is fake
- name. Under this case, j will not increase if this dimension doesnot
+ name. Under this case, count_h5objref and count_h5attrname
+ will not increase if this dimension doesnot
have dimensional scale data. That assures the object reference of sds is
correct. */