summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2021-01-08 11:59:28 -0600
committerDavid Teigland <teigland@redhat.com>2021-01-08 12:13:05 -0600
commita4c56a3bc342ab42fdfc9c9538b3fa7feba49412 (patch)
tree7c8f1e65b65df5a5034143472e09aec4b4c80fa7
parent6308365d485a741d36c98060a00e95892fc3d21f (diff)
downloadlvm2-a4c56a3bc342ab42fdfc9c9538b3fa7feba49412.tar.gz
lvmlockd: sscanf buffer size warnings
-rw-r--r--daemons/lvmlockd/lvmlockd-core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c
index fea8ee6cf..c4abf66be 100644
--- a/daemons/lvmlockd/lvmlockd-core.c
+++ b/daemons/lvmlockd/lvmlockd-core.c
@@ -896,8 +896,9 @@ static int read_adopt_file(struct list_head *vg_lockd)
goto fail;
memset(vg_uuid, 0, sizeof(vg_uuid));
+ memset(lm_type_str, 0, sizeof(lm_type_str));
- if (sscanf(adopt_line, "VG: %63s %64s %16s %64s",
+ if (sscanf(adopt_line, "VG: %63s %64s %15s %64s",
vg_uuid, ls->vg_name, lm_type_str, ls->vg_args) != 4) {
goto fail;
}
@@ -916,8 +917,9 @@ static int read_adopt_file(struct list_head *vg_lockd)
r->type = LD_RT_LV;
memset(vg_uuid, 0, sizeof(vg_uuid));
+ memset(mode, 0, sizeof(mode));
- if (sscanf(adopt_line, "LV: %64s %64s %s %8s %u",
+ if (sscanf(adopt_line, "LV: %64s %64s %s %7s %u",
vg_uuid, r->name, r->lv_args, mode, &r->version) != 5) {
goto fail;
}