diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2000-09-06 03:40:21 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2000-09-06 03:40:21 (GMT) |
commit | 404ee60bd41e53144b5f405507ae1a319a0ae8af (patch) | |
tree | 1b524303f03af2027748a67de6668bbaa9b60369 /src/H5F.c | |
parent | b8f8c8cb90826fc79fca22c0ae33bf1b1940eec3 (diff) | |
download | hdf5-404ee60bd41e53144b5f405507ae1a319a0ae8af.zip hdf5-404ee60bd41e53144b5f405507ae1a319a0ae8af.tar.gz hdf5-404ee60bd41e53144b5f405507ae1a319a0ae8af.tar.bz2 |
[svn-r2508] Purpose:
Bug fixes
Description:
All tests were core=dumping in IRIX64. The bug is in Generic
property list creation in which malloc asked for 2*64-1 bytes
due to coding bug. The object creation failed but the return
code was not checked. Program eventually crashed.
Solution:
H5F.c:
Check the return code from new file object creation and flag
error accordingly.
H5FL.c:
H5FL_arr_free is a replacement for H5MM_xfree which accepts
null value as a legal argument value. H5FL_arr_free assert
on it. Since other parts of the code have been passing null
value to H5MM_xfree, H5FL_arr_free must accept it too until
all the calling routines are changed to not pass Null.
H5P.c:
some routine passes in 0 as the hashsize value which is uintn.
The expression (hashsize-1) underflows to the largest unsigned
int for some machines. Thus the calloc failed. Cast hashsize
to unsigned int first (this assumes hashsize stays within the
signed int data range.
H5Smpio.c:
Added the extra parameter because the H5FD_write has been redefined.
Platforms tested:
IRIX64 -64 and -n32
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1055,7 +1055,9 @@ H5F_open(const char *name, uintn flags, hid_t fcpl_id, hid_t fapl_id) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file"); } - file = H5F_new(NULL, fcpl_id, fapl_id); + if (NULL==(file = H5F_new(NULL, fcpl_id, fapl_id))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, + "unable to create new file object"); file->shared->flags = flags; file->shared->lf = lf; } else { @@ -1063,7 +1065,9 @@ H5F_open(const char *name, uintn flags, hid_t fcpl_id, hid_t fapl_id) * This file is not yet open by the library and our tentative opening * above is good enough. */ - file = H5F_new(NULL, fcpl_id, fapl_id); + if (NULL==(file = H5F_new(NULL, fcpl_id, fapl_id))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, + "unable to create new file object"); file->shared->flags = flags; file->shared->lf = lf; } |