diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2009-06-25 18:58:51 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2009-06-25 18:58:51 (GMT) |
commit | f5fddfb7c1d055085b0bcf785f1124f69d63c475 (patch) | |
tree | cb03c6b7349c206b5b58ebd6da0ace7fc8d2820d /test | |
parent | c76a57f55705831ce7be4b606a8feacf055cc073 (diff) | |
download | hdf5-f5fddfb7c1d055085b0bcf785f1124f69d63c475.zip hdf5-f5fddfb7c1d055085b0bcf785f1124f69d63c475.tar.gz hdf5-f5fddfb7c1d055085b0bcf785f1124f69d63c475.tar.bz2 |
[svn-r17109] Purpose: Fix bug in H5Z_filter_info
Description:
Previously, when H5Z_filter_info was called for a filter that was not present,
it would succeed and return the information from one position past the end of
the pipeline, possibly causing a segfault. This affected at least
H5Pget_fitler_by_id1/2, and possibly other API functions. Fixed to properly
return failure.
Tested: jam, linew, smirom (h5committest)
Diffstat (limited to 'test')
-rw-r--r-- | test/dsets.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/dsets.c b/test/dsets.c index 71324d8..3357a4e 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -5547,6 +5547,7 @@ test_filter_delete(hid_t file) hsize_t dims[2]={20,20}; /* dataspace dimensions */ hsize_t chunk_dims[2]={10,10}; /* chunk dimensions */ int nfilters; /* number of filters in DCPL */ + unsigned flags; /* flags for filter */ herr_t ret; /* generic return value */ int i; @@ -5587,6 +5588,16 @@ test_filter_delete(hid_t file) goto error; } + /* try to get the info for the deflate filter */ + H5E_BEGIN_TRY { + ret=H5Pget_filter_by_id2(dcpl1,H5Z_FILTER_DEFLATE,&flags,NULL,NULL,0,NULL,NULL); + } H5E_END_TRY; + if(ret >=0) { + H5_FAILED(); + printf(" Line %d: Shouldn't have deleted filter!\n",__LINE__); + goto error; + } /* end if */ + /* try to delete the deflate filter again */ H5E_BEGIN_TRY { ret=H5Premove_filter(dcpl1,H5Z_FILTER_DEFLATE); |