blobstore: Add the size check of length field in desc_xattr
Change-Id: I522b29b3a603b1e83c866486d036137ee4fafcbd Signed-off-by: Ziye Yang <ziye.yang@intel.com>
This commit is contained in:
parent
9ed75e4dab
commit
4c9645b555
@ -221,6 +221,10 @@ _spdk_blob_parse_page(const struct spdk_blob_md_page *page, struct spdk_blob *bl
|
||||
|
||||
desc_xattr = (struct spdk_blob_md_descriptor_xattr *)desc;
|
||||
|
||||
assert(desc_xattr->length == sizeof(desc_xattr->name_length) +
|
||||
sizeof(desc_xattr->value_length) +
|
||||
desc_xattr->name_length + desc_xattr->value_length);
|
||||
|
||||
xattr = calloc(1, sizeof(*xattr));
|
||||
assert(xattr != NULL);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user