summaryrefslogtreecommitdiffstats
path: root/src/H5Gnode.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-06-21 16:53:39 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-06-21 16:53:39 (GMT)
commit4402923400e705eac6d28f97518bf18c536f6c80 (patch)
treed6e4254a561072885795c0f7881ccddbbfd79895 /src/H5Gnode.c
parent8263f168f703f8a680a49419a0053c384abec4c3 (diff)
downloadhdf5-4402923400e705eac6d28f97518bf18c536f6c80.zip
hdf5-4402923400e705eac6d28f97518bf18c536f6c80.tar.gz
hdf5-4402923400e705eac6d28f97518bf18c536f6c80.tar.bz2
[svn-r4038] Purpose:
Code clean/bug fix Description: H5FL (free-list manager) code currently is taking an hsize_t as the size of a memory block to allocate. On many machines, the size of an hsize_t is greater than the size of a size_t, potentially leading to incorrect memory allocations in rare circumstances. Solution: Changed hsize_t parameters and variables to size_t. Platforms tested: FreeBSD 4.3 (hawkwind)
Diffstat (limited to 'src/H5Gnode.c')
-rw-r--r--src/H5Gnode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index 90a7c79..3847a46 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -272,7 +272,7 @@ H5G_node_create(H5F_t *f, H5B_ins_t UNUSED op, void *_lt_key,
"unable to allocate file space");
}
sym->dirty = TRUE;
- sym->entry = H5FL_ARR_ALLOC(H5G_entry_t,(hsize_t)(2*H5G_NODE_K(f)),1);
+ sym->entry = H5FL_ARR_ALLOC(H5G_entry_t,(2*H5G_NODE_K(f)),1);
if (NULL==sym->entry) {
H5FL_FREE(H5G_node_t,sym);
HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
@@ -347,7 +347,7 @@ H5G_node_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5G_node_t *sym)
size = H5G_node_size(f);
/* Allocate temporary buffer */
- if ((buf=H5FL_BLK_ALLOC(symbol_node,(hsize_t)size, 0))==NULL)
+ if ((buf=H5FL_BLK_ALLOC(symbol_node,size, 0))==NULL)
HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed");
p=buf;
@@ -439,7 +439,7 @@ H5G_node_load(H5F_t *f, haddr_t addr, const void UNUSED *_udata1,
"memory allocation failed for symbol table node");
p=buf;
if (NULL==(sym = H5FL_ALLOC(H5G_node_t,1)) ||
- NULL==(sym->entry=H5FL_ARR_ALLOC(H5G_entry_t,(hsize_t)(2*H5G_NODE_K(f)),1))) {
+ NULL==(sym->entry=H5FL_ARR_ALLOC(H5G_entry_t,(2*H5G_NODE_K(f)),1))) {
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL,
"memory allocation failed");
}