diff options
Diffstat (limited to 'src/H5Oattr.c')
-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 f816b2c..1493403 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -340,7 +340,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); |