summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-09-28 19:07:43 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-09-28 19:07:43 (GMT)
commited0ebdd7d0c11c0823f3f417a8ce112f7c7c18bf (patch)
treea95b1e2b1f4c3efb86251be324f4b6c4b5c20f59 /src
parentc6841592464be5559404d0b108e3eac2efdc9d33 (diff)
downloadhdf5-ed0ebdd7d0c11c0823f3f417a8ce112f7c7c18bf.zip
hdf5-ed0ebdd7d0c11c0823f3f417a8ce112f7c7c18bf.tar.gz
hdf5-ed0ebdd7d0c11c0823f3f417a8ce112f7c7c18bf.tar.bz2
[svn-r9331] 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')
-rw-r--r--src/H5FDcore.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index c1114fe..d34b5a5 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -76,10 +76,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))