summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-03-06 15:50:51 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-03-06 15:50:51 (GMT)
commit2f9851501959a64fb092b599041e0d9ecc63f6f8 (patch)
tree30eecfd6e85b4236309260ebd63df1a614effdb1
parent509b8f645deadb880ea09ca5d89f9a28526d78ec (diff)
downloadhdf5-2f9851501959a64fb092b599041e0d9ecc63f6f8.zip
hdf5-2f9851501959a64fb092b599041e0d9ecc63f6f8.tar.gz
hdf5-2f9851501959a64fb092b599041e0d9ecc63f6f8.tar.bz2
[svn-r13466] Description:
Add some extra sanity checking to object header status flags read from file. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
-rw-r--r--src/H5Ocache.c5
-rw-r--r--src/H5Opkg.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index 48e3a6d..7d096d5 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -48,6 +48,9 @@
* extra I/O operations) */
#define H5O_SPEC_READ_SIZE 512
+/* All the object header status flags that this version of the library knows about */
+#define H5O_HDR_ALL_FLAGS (H5O_HDR_ATTR_CRT_ORDER_TRACKED | H5O_HDR_ATTR_CRT_ORDER_INDEXED | H5O_HDR_STORE_TIMES)
+
/******************/
/* Local Typedefs */
@@ -276,6 +279,8 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1,
/* Flags */
oh->flags = *p++;
+ if(oh->flags & ~H5O_HDR_ALL_FLAGS)
+ HGOTO_ERROR(H5E_OHDR, H5E_VERSION, NULL, "unknown object header status flag(s)")
} /* end if */
else {
/* Version */
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index 6825210..d8a6fd2 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -240,7 +240,7 @@ struct H5O_t {
uint8_t version; /*version number */
uint8_t flags; /*flags */
- /* Time information (stored, for versions > 1) */
+ /* Time information (stored, for versions > 1 & H5O_HDR_STORE_TIMES flag set) */
time_t atime; /*access time */
time_t mtime; /*modification time */
time_t ctime; /*change time */