From c6841592464be5559404d0b108e3eac2efdc9d33 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 27 Sep 2004 23:34:40 -0500 Subject: [svn-r9328] Purpose: Bug fix. Description: Fix off-by-one error in Core VFL driver which would cause spurious address or size overflow errors when an odd valued address or size was checked. Platforms tested: FreeBSD 4.10 (sleipnir) Linux 2.4 (heping) Solaris 2.7 (arabica) --- release_docs/RELEASE.txt | 4 +++- src/H5FDcore.c | 8 +------- src/H5FDsec2.c | 5 ----- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 0a7c6f7..4c11f62 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -62,8 +62,10 @@ Bug Fixes since HDF5-1.6.3 release Library ------- + - Fixed address check in Core VFL driver to avoid spurious address/size + overflows for odd valued addresses and/or sizes. QAK - 2004/09/27 - Fixed problem where chunked datasets were not able to be deleted - from a file under certain circumstances (QAK - 09/27/2004) + from a file under certain circumstances. QAK - 2004/09/27/ Configuration ------------- diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 370d868..c1114fe 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -34,12 +34,6 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ -#undef MAX -#define MAX(X,Y) ((X)>(Y)?(X):(Y)) - -#undef MIN -#define MIN(X,Y) ((X)<(Y)?(X):(Y)) - /* The driver identification number, initialized at runtime */ static hid_t H5FD_CORE_g = 0; @@ -82,7 +76,7 @@ typedef struct H5FD_core_fapl_t { * REGION_OVERFLOW: Checks whether an address and size pair describe data * which can be addressed entirely in memory. */ -#define MAXADDR ((haddr_t)((~(size_t)0)-1)) +#define MAXADDR ((haddr_t)(~(size_t)0)) #define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || \ ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 05720e7..44d3912 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -38,11 +38,6 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ -#ifdef MAX -#undef MAX -#define MAX(X,Y) ((X)>(Y)?(X):(Y)) -#endif /* MAX */ - /* The driver identification number, initialized at runtime */ static hid_t H5FD_SEC2_g = 0; -- cgit v0.12