mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-17 16:10:24 +08:00
[svn-r101] Fixed uninitialized memory read.
This commit is contained in:
parent
25d866e9b4
commit
c956e7e73a
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
/*
|
||||
|
@ -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. */
|
||||
|
@ -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...
|
||||
|
Loading…
Reference in New Issue
Block a user