summaryrefslogtreecommitdiffstats
path: root/src/H5HG.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-11-13 15:20:23 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-11-13 15:20:23 (GMT)
commit898ba82d42aa46cbca59fca31f47d5bce3e8dd72 (patch)
tree33a1c536ed8ed4a1654bf898ccca4622f9547aaf /src/H5HG.c
parentdd241064c18efe59768cc5b495fe78b2a779b058 (diff)
downloadhdf5-898ba82d42aa46cbca59fca31f47d5bce3e8dd72.zip
hdf5-898ba82d42aa46cbca59fca31f47d5bce3e8dd72.tar.gz
hdf5-898ba82d42aa46cbca59fca31f47d5bce3e8dd72.tar.bz2
[svn-r7844] Purpose:
Bug fix Description: Variable length strings and sequences with NULL pointers were not handled by library, causing problems access the data. This also affected fill values for variable-length datatypes. Solution: Address the issues in the library by detecting NULL sequences/strings and avoid trying to convert them. Patched up dumper to display NULL sequences/strings. Platforms tested: FreeBSD 4.9 (sleipnir) h5committest
Diffstat (limited to 'src/H5HG.c')
-rw-r--r--src/H5HG.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/H5HG.c b/src/H5HG.c
index 4d0e52d..f463b1c 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -743,9 +743,11 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*
assert (idx>0);
/* Copy data into the heap */
- HDmemcpy(heap->obj[idx].begin+H5HG_SIZEOF_OBJHDR(f), obj, size);
- HDmemset(heap->obj[idx].begin+H5HG_SIZEOF_OBJHDR(f)+size, 0,
- need-(H5HG_SIZEOF_OBJHDR(f)+size));
+ if(size>0) {
+ HDmemcpy(heap->obj[idx].begin+H5HG_SIZEOF_OBJHDR(f), obj, size);
+ HDmemset(heap->obj[idx].begin+H5HG_SIZEOF_OBJHDR(f)+size, 0,
+ need-(H5HG_SIZEOF_OBJHDR(f)+size));
+ } /* end if */
heap->cache_info.dirty = TRUE;
/* Return value */