diff --git a/libsrc/posixio.c b/libsrc/posixio.c index f1a1cd75b0..d803ca86cc 100644 --- a/libsrc/posixio.c +++ b/libsrc/posixio.c @@ -63,7 +63,7 @@ #undef MIN /* system may define MIN somewhere and complain */ #define MIN(mm,nn) (((mm) < (nn)) ? (mm) : (nn)) -#if !defined(NDEBUG) && !defined(X_INT_MAX) +#if /*!defined(NDEBUG) &&*/ !defined(X_INT_MAX) #define X_INT_MAX 2147483647 #endif @@ -536,9 +536,8 @@ px_get(ncio *const nciop, ncio_px *const pxp, off_t diff = (size_t)(offset - blkoffset); off_t blkextent = _RNDUP(diff + extent, pxp->blksz); - assert(extent != 0); - assert(extent < X_INT_MAX); /* sanity check */ - assert(offset >= 0); /* sanity check */ + if(!(extent != 0 && extent < X_INT_MAX && offset >= 0)) /* sanity check */ + return NC_ENOTNC; if(2 * pxp->blksz < blkextent) return E2BIG; /* TODO: temporary kludge */ diff --git a/nc_test/test_byterange.sh b/nc_test/test_byterange.sh index 38923bfa03..fe9a2cb487 100755 --- a/nc_test/test_byterange.sh +++ b/nc_test/test_byterange.sh @@ -86,7 +86,9 @@ ${NCDUMP} -n nc_enddef "$U" >tmp_${TAG}.cdl diff -wb tmp_$TAG.cdl ${srcdir}/nc_enddef.cdl } +if test "x$FEATURE_S3TESTS" = xyes ; then testsetup https://s3.us-east-1.amazonaws.com/unidata-zarr-test-data +fi echo "*** Testing reading NetCDF-3 file with http"