Commit abc73f69 authored by Ben Walker's avatar Ben Walker Committed by Daniel Verkamp
Browse files

blob: Handle failure to alloc xattr on parse



Or rather, at least assert that the allocation failed.
This is not a recoverable error in general.

Change-Id: I9bc325066e829fc311ce84ce83536e9933ac5473
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 88213615
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -231,6 +231,7 @@ _spdk_blob_parse_page(const struct spdk_blob_md_page *page, struct spdk_blob *bl
			assert(xattr != NULL);

			xattr->name = malloc(desc_xattr->name_length + 1);
			assert(xattr->name);
			strncpy(xattr->name, desc_xattr->name, desc_xattr->name_length);
			xattr->name[desc_xattr->name_length] = '\0';