From 442113f2d338903274e4bb30e91c2564919145f3 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 17 Jan 2017 20:32:54 -0800 Subject: [PATCH] xattr.h: statically verify size of xattr header --- include/wimlib/xattr.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/wimlib/xattr.h b/include/wimlib/xattr.h index e2eee000..2fc5f6dc 100644 --- a/include/wimlib/xattr.h +++ b/include/wimlib/xattr.h @@ -45,6 +45,8 @@ struct wimlib_xattr_entry { static inline size_t xattr_entry_size(const struct wimlib_xattr_entry *entry) { + STATIC_ASSERT(sizeof(*entry) == 8); + return ALIGN(sizeof(*entry) + le16_to_cpu(entry->name_len) + le32_to_cpu(entry->value_len), 4); } -- 2.43.0