summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-09-19 18:11:56 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-09-19 18:11:56 (GMT)
commitc956e7e73a46009081b9c3e0a1eac003829a884a (patch)
treebc6ed8914886bcb67731397222d90991ee46cf7a /src
parent25d866e9b433142c38fa6c4c8d3cad5e00d46163 (diff)
downloadhdf5-c956e7e73a46009081b9c3e0a1eac003829a884a.zip
hdf5-c956e7e73a46009081b9c3e0a1eac003829a884a.tar.gz
hdf5-c956e7e73a46009081b9c3e0a1eac003829a884a.tar.bz2
[svn-r101] Fixed uninitialized memory read.
Diffstat (limited to 'src')
-rw-r--r--src/H5Gnode.c7
-rw-r--r--src/H5Gpkg.h2
-rw-r--r--src/H5Gshad.c17
-rw-r--r--src/Makefile.in2
4 files changed, 11 insertions, 17 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index 0729a78..aa3175c 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -382,7 +382,7 @@ H5G_node_load (hdf5_file_t *f, haddr_t addr, void *_udata)
H5G_node_t *sym = NULL;
size_t size = 0;
uint8 *buf = NULL, *p = NULL;
- H5G_entry_t *self = NULL;
+ H5G_ac_ud1_t *ac_udata = (H5G_ac_ud1_t*)_udata;
H5G_node_t *ret_value = NULL; /*for error handling*/
FUNC_ENTER (H5G_node_load, NULL, NULL);
@@ -392,8 +392,7 @@ H5G_node_load (hdf5_file_t *f, haddr_t addr, void *_udata)
*/
assert (f);
assert (addr>=0);
- assert (_udata);
- self = (H5G_entry_t*)_udata;
+ assert (ac_udata);
/*
* Initialize variables.
@@ -431,7 +430,7 @@ H5G_node_load (hdf5_file_t *f, haddr_t addr, void *_udata)
buf = H5MM_xfree (buf);
/* shadows */
- if (H5G_shadow_assoc_node (f, sym, self)<0) {
+ if (H5G_shadow_assoc_node (f, sym, ac_udata)<0) {
HGOTO_ERROR (H5E_SYM, H5E_CANTLOAD, NULL);
}
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index 5a33d8d..c5ccae9 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -146,7 +146,7 @@ herr_t H5G_shadow_close (hdf5_file_t *f, H5G_entry_t *ent);
hbool_t H5G_shadow_p (H5G_entry_t *ent);
herr_t H5G_shadow_dissociate (H5G_entry_t *ent);
herr_t H5G_shadow_assoc_node (hdf5_file_t *f, H5G_node_t *sym,
- H5G_entry_t *self);
+ H5G_ac_ud1_t *ac_udata);
H5G_shadow_t *H5G_shadow_list (haddr_t stab_header_addr);
/*
diff --git a/src/H5Gshad.c b/src/H5Gshad.c
index 5de4b29..6dc997f 100644
--- a/src/H5Gshad.c
+++ b/src/H5Gshad.c
@@ -209,32 +209,27 @@ H5G_shadow_list (haddr_t dir_addr)
*-------------------------------------------------------------------------
*/
herr_t
-H5G_shadow_assoc_node (hdf5_file_t *f, H5G_node_t *sym, H5G_entry_t *self)
+H5G_shadow_assoc_node (hdf5_file_t *f, H5G_node_t *sym, H5G_ac_ud1_t *ac_udata)
{
H5G_shadow_t *shadow = NULL;
- H5O_stab_t stab;
const char *s = NULL;
intn i = 0;
+ haddr_t heap_addr;
FUNC_ENTER (H5G_shadow_assoc_node, NULL, FAIL);
/* Check arguments */
assert (f); /* The file */
assert (sym); /* The symbol table node */
- assert (self); /* The symbol table header info */
+ assert (ac_udata); /* The symbol table header info */
- if ((shadow=H5G_shadow_list (self->header))) {
-
- /* We need the heap address so we can see the symbol names */
- if (NULL==H5O_read (f, self->header, self, H5O_NAME, 0, &stab)) {
- HRETURN_ERROR (H5E_SYM, H5E_BADMESG, FAIL);
- }
+ if ((shadow=H5G_shadow_list (ac_udata->dir_addr))) {
+ heap_addr = ac_udata->heap_addr;
while (i<sym->nsyms && shadow) {
-
/* Advance the Entry ptr until it gets to the next shadow. */
while (i<sym->nsyms &&
- (s=H5H_peek (f, stab.heap_addr, sym->entry[i].name_off)) &&
+ (s=H5H_peek (f, heap_addr, sym->entry[i].name_off)) &&
strcmp (s, shadow->name)<0) i++;
/* Advance the Shadow ptr until it gets to the next entry. */
diff --git a/src/Makefile.in b/src/Makefile.in
index 0a66e9d..9308965 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -34,7 +34,7 @@ PUB_HDR=H5public.h H5Apublic.h H5ACpublic.h H5Bpublic.h H5Cpublic.h \
# Other header files (not to be installed)...
PRIVATE_HDR=H5private.h H5Aprivate.h H5ACprivate.h H5Bprivate.h \
H5Cprivate.h H5Dprivate.h H5Eprivate.h H5Fprivate.h H5Gprivate.h \
- H5Hprivate.h H5Mprivate.h H5MFprivate.h H5MMprivate.h \
+ H5Gpkg.h H5Hprivate.h H5Mprivate.h H5MFprivate.h H5MMprivate.h \
H5Oprivate.h H5Pprivate.h H5Tprivate.h
# How to build the programs...