From a6862cb3bb3b00a1d6704b2bd1fedbd1374be861 Mon Sep 17 00:00:00 2001
From: Lans Zhang <jia.zhang@windriver.com>
Date: Thu, 6 Apr 2017 11:11:14 +0800
Subject: [PATCH] image: fix the segment fault caused by the uninitialized
 sigbuf

The uninitialized struct image might contain a non-zeroed sigbuf and then
it is wrongly freed by image_add_signature().

Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
---
 src/image.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/image.c b/src/image.c
index cc55791..644e8f1 100644
--- a/src/image.c
+++ b/src/image.c
@@ -395,7 +395,7 @@ struct image *image_load(const char *filename)
 	struct image *image;
 	int rc;
 
-	image = talloc(NULL, struct image);
+	image = talloc_zero(NULL, struct image);
 	if (!image) {
 		perror("talloc(image)");
 		return NULL;
-- 
2.11.0

