diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-10-28 21:59:56 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-10-28 21:59:56 (GMT) |
commit | 7abd8c4d3003d56f6564a79dd0eaa4d97604a769 (patch) | |
tree | e17f5afbc1293d9ae0909ecbe0c503172b68b31c | |
parent | 1697bf666b4f826d46757a284a1bf73e7f7e4feb (diff) | |
download | hdf5-7abd8c4d3003d56f6564a79dd0eaa4d97604a769.zip hdf5-7abd8c4d3003d56f6564a79dd0eaa4d97604a769.tar.gz hdf5-7abd8c4d3003d56f6564a79dd0eaa4d97604a769.tar.bz2 |
[svn-r17779] Description:
Bring r17778 from trunk to 1.8 branch:
Make check for NULL dataspace a bit safer.
Tested on:
FreeBSD/32 6.3 (duty)
(too minor for h5committest)
-rw-r--r-- | src/H5Dio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c index 463c56e..a4cf92f 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -159,7 +159,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, else if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - if(!buf && H5S_GET_SELECT_NPOINTS(file_space) != 0) + if(!buf && (NULL == file_space || H5S_GET_SELECT_NPOINTS(file_space) != 0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer") /* If the buffer is nil, and 0 element is selected, make a fake buffer. @@ -251,7 +251,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, else if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - if(!buf && H5S_GET_SELECT_NPOINTS(file_space) != 0) + if(!buf && (NULL == file_space || H5S_GET_SELECT_NPOINTS(file_space) != 0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer") /* If the buffer is nil, and 0 element is selected, make a fake buffer. |