From 0475c8ce57f84ced2e8ab35dabbcde6bd4e4e3fa Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 28 Oct 2009 16:58:05 -0500 Subject: [svn-r17778] Description: Make check for NULL dataspace a bit safer. Tested on: FreeBSD/32 6.3 (duty) (too minor for h5committest) --- src/H5Dio.c | 4 ++-- 1 file 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. -- cgit v0.12