From 377e326156c74ef7aa7f5ac286bdabe3143a0b49 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 21 Sep 2021 18:13:05 +0200 Subject: [PATCH] cov: ensuring buffer is zeroed --- daemons/lvmlockd/lvmlockctl.c | 1 + daemons/lvmlockd/lvmlockd-dlm.c | 1 + 2 files changed, 2 insertions(+) diff --git a/daemons/lvmlockd/lvmlockctl.c b/daemons/lvmlockd/lvmlockctl.c index 32da99c6d..45569e694 100644 --- a/daemons/lvmlockd/lvmlockctl.c +++ b/daemons/lvmlockd/lvmlockctl.c @@ -457,6 +457,7 @@ retry: if (count < dump_len) goto retry; + dump_buf[count] = 0; rv = 0; if ((info && dump) || !strcmp(req_name, "dump")) printf("%s\n", dump_buf); diff --git a/daemons/lvmlockd/lvmlockd-dlm.c b/daemons/lvmlockd/lvmlockd-dlm.c index 67e7bee03..68d18607c 100644 --- a/daemons/lvmlockd/lvmlockd-dlm.c +++ b/daemons/lvmlockd/lvmlockd-dlm.c @@ -119,6 +119,7 @@ static int read_cluster_name(char *clustername) log_error(close_error_msg, fd); return rv; } + clustername[rv] = 0; n = strstr(clustername, "\n"); if (n)