From abc73f6995d1005d4177036c735d21dd60ef7ba1 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Mon, 27 Mar 2017 10:01:15 -0700 Subject: [PATCH] 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: Ben Walker --- lib/blob/blobstore.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/blob/blobstore.c b/lib/blob/blobstore.c index 3905a3894..673e45948 100644 --- a/lib/blob/blobstore.c +++ b/lib/blob/blobstore.c @@ -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';