From 2f9851501959a64fb092b599041e0d9ecc63f6f8 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 6 Mar 2007 10:50:51 -0500 Subject: [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) --- src/H5Ocache.c | 5 +++++ src/H5Opkg.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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 */ -- cgit v0.12