diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Oattr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c index f454b74..3bb9bd8 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -344,7 +344,10 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg) p += attr->ds_size; /* Store attribute data */ - HDmemcpy(p,attr->data,attr->data_size); + if(attr->data) + HDmemcpy(p,attr->data,attr->data_size); + else + HDmemset(p,0,attr->data_size); done: FUNC_LEAVE_NOAPI(ret_value); |