From 89770db4ef94dd990e718fa8ce5b0a33f54c3237 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 14 May 2019 15:00:01 +0200 Subject: fdisk: initialize buffers for get_user_reply() [coverity scan] It's probably unnecessary, but better be safe than sorry. Signed-off-by: Karel Zak --- disk-utils/fdisk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'disk-utils/fdisk.c') diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c index c27485af2..380f3f445 100644 --- a/disk-utils/fdisk.c +++ b/disk-utils/fdisk.c @@ -397,7 +397,7 @@ int ask_callback(struct fdisk_context *cxt, struct fdisk_ask *ask, void *data __attribute__((__unused__))) { int rc = 0; - char buf[BUFSIZ]; + char buf[BUFSIZ] = { '\0' }; assert(cxt); assert(ask); @@ -482,7 +482,7 @@ static struct fdisk_parttype *ask_partition_type(struct fdisk_context *cxt, int _("Hex code (type L to list all codes): ") : _("Partition type (type L to list all types): "); do { - char buf[256]; + char buf[256] = { '\0' }; int rc = get_user_reply(q, buf, sizeof(buf)); if (rc) { -- cgit v1.2.3-55-g7522