From b1600db1068da73f006283e32c7d72bd8f5bd328 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Mon, 13 Jun 2022 13:14:55 -0600 Subject: [PATCH] Fix nc_def_var_fletcher32 operation re: Github Issue https://github.com/Unidata/netcdf-c/issues/2401 The nc_def_var_fletcher32 code in hdf5 is always setting fletcher32 when invoked. Fix is to properly test value of the fletcher32 argument. --- libhdf5/hdf5var.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libhdf5/hdf5var.c b/libhdf5/hdf5var.c index 287d5dfef2..0dfd9ef808 100644 --- a/libhdf5/hdf5var.c +++ b/libhdf5/hdf5var.c @@ -542,7 +542,7 @@ nc_def_var_extra(int ncid, int varid, int *shuffle, int *unused1, } /* Fletcher32 checksum error protection? */ - if (fletcher32 && fletcher32) { + if (fletcher32 && *fletcher32) { retval = nc_inq_var_filter_info(ncid,varid,H5Z_FILTER_FLETCHER32,NULL,NULL); if(!retval || retval == NC_ENOFILTER) { if((retval = nc_def_var_filter(ncid,varid,H5Z_FILTER_FLETCHER32,0,NULL))) return retval;