Also 0-fill the new item, including the padding.
These changes have no effect on the only caller of
inode_add_tagged_item() but should be made for correctness in case this
function gets more callers in the future.
/* We prepend the item instead of appending it because it's easier. */
/* We prepend the item instead of appending it because it's easier. */
- itemsize = sizeof(struct tagged_item_header) + len;
+ itemsize = sizeof(struct tagged_item_header) + ((len + 7) & ~7);
newsize = itemsize + inode->i_extra_size;
buf = MALLOC(newsize);
newsize = itemsize + inode->i_extra_size;
buf = MALLOC(newsize);
hdr = (struct tagged_item_header *)buf;
hdr->tag = cpu_to_le32(tag);
hdr->length = cpu_to_le32(len);
hdr = (struct tagged_item_header *)buf;
hdr->tag = cpu_to_le32(tag);
hdr->length = cpu_to_le32(len);
+ return memset(hdr->data, 0, (len + 7) & ~7);
}
static inline struct wimlib_unix_data_disk *
}
static inline struct wimlib_unix_data_disk *