summaryrefslogtreecommitdiffstats
path: root/disk-utils/fdisk.c
diff options
context:
space:
mode:
authorKarel Zak2019-05-14 15:00:01 +0200
committerKarel Zak2019-05-14 15:00:01 +0200
commit89770db4ef94dd990e718fa8ce5b0a33f54c3237 (patch)
treed897464fccaab57319d26ad47db124a0e9003155 /disk-utils/fdisk.c
parentbuild-sys: add --with-pkgconfigdir (diff)
downloadkernel-qcow2-util-linux-89770db4ef94dd990e718fa8ce5b0a33f54c3237.tar.gz
kernel-qcow2-util-linux-89770db4ef94dd990e718fa8ce5b0a33f54c3237.tar.xz
kernel-qcow2-util-linux-89770db4ef94dd990e718fa8ce5b0a33f54c3237.zip
fdisk: initialize buffers for get_user_reply() [coverity scan]
It's probably unnecessary, but better be safe than sorry. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/fdisk.c')
-rw-r--r--disk-utils/fdisk.c4
1 files changed, 2 insertions, 2 deletions
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) {