From cfe4691c6f70379c9a615307bd6589fe7d1cec92 Mon Sep 17 00:00:00 2001 From: Roddy Shuler Date: Thu, 2 Nov 2017 21:22:51 -0700 Subject: [PATCH] libfdisk: Fix uninitialized structure Without this, 'sfdisk -d' with certain filenames would lead to reading an 's' from the 'type' field in fdisk_reset_labelitem and cause a crash due to prematurely freeing the 'data.str' field. Signed-off-by: Roddy Shuler --- libfdisk/src/script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c index b0ac8b2458..d7ff113859 100644 --- a/libfdisk/src/script.c +++ b/libfdisk/src/script.c @@ -418,7 +418,7 @@ int fdisk_script_read_context(struct fdisk_script *dp, struct fdisk_context *cxt rc = fdisk_script_set_header(dp, "unit", "sectors"); if (!rc && fdisk_is_label(cxt, GPT)) { - struct fdisk_labelitem item; + struct fdisk_labelitem item = FDISK_LABELITEM_INIT; char buf[64]; /* first-lba */ -- 2.47.3