xattr.h: statically verify size of xattr header
authorEric Biggers <ebiggers3@gmail.com>
Wed, 18 Jan 2017 04:32:54 +0000 (20:32 -0800)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 18 Jan 2017 05:29:15 +0000 (21:29 -0800)
include/wimlib/xattr.h

index e2eee00..2fc5f6d 100644 (file)
@@ -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);
 }