summaryrefslogtreecommitdiffstats
path: root/src/H5FDcore.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-09-28 19:07:01 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-09-28 19:07:01 (GMT)
commit85597e5cc7822712fb60baf30f3109d3a14f3c51 (patch)
treedec571675a4c6c4b5492087b03c91ef542daf9a9 /src/H5FDcore.c
parent5c0011a71384223791d18028968382db43f08a6f (diff)
downloadhdf5-85597e5cc7822712fb60baf30f3109d3a14f3c51.zip
hdf5-85597e5cc7822712fb60baf30f3109d3a14f3c51.tar.gz
hdf5-85597e5cc7822712fb60baf30f3109d3a14f3c51.tar.bz2
[svn-r9330] Purpose:
Bug fix Description: Another attempt to fix the address overflow in the core VFL, hopefully one that works on 64-bit platforms. Platforms tested: AIX 5.1 (copper)
Diffstat (limited to 'src/H5FDcore.c')
-rw-r--r--src/H5FDcore.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index 4b26335..1b3d877 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -79,10 +79,9 @@ 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))
-#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || \
- ((A) & ~(haddr_t)MAXADDR))
-#define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR)
+#define MAXADDR ((haddr_t)((~(size_t)0)-1))
+#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || (A) > (haddr_t)MAXADDR)
+#define SIZE_OVERFLOW(Z) ((Z) > (hsize_t)MAXADDR)
#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \
HADDR_UNDEF==(A)+(Z) || \
(size_t)((A)+(Z))<(size_t)(A))