summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-10-28 21:58:05 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-10-28 21:58:05 (GMT)
commit0475c8ce57f84ced2e8ab35dabbcde6bd4e4e3fa (patch)
tree973cf1c092417caeb05df0a760a6aa885ac52206
parentf736e4ca18b48c621af642ba9226fe0568b7a21d (diff)
downloadhdf5-0475c8ce57f84ced2e8ab35dabbcde6bd4e4e3fa.zip
hdf5-0475c8ce57f84ced2e8ab35dabbcde6bd4e4e3fa.tar.gz
hdf5-0475c8ce57f84ced2e8ab35dabbcde6bd4e4e3fa.tar.bz2
[svn-r17778] Description:
Make check for NULL dataspace a bit safer. Tested on: FreeBSD/32 6.3 (duty) (too minor for h5committest)
-rw-r--r--src/H5Dio.c4
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.