mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 2 years ago
Clone

Blame SOURCES/lvm2-2_03_12-lvmlockd-sscanf-buffer-size-warnings.patch

abb29f
 daemons/lvmlockd/lvmlockd-core.c | 6 ++++--
abb29f
 1 file changed, 4 insertions(+), 2 deletions(-)
abb29f
abb29f
diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c
abb29f
index fea8ee6..c4abf66 100644
abb29f
--- a/daemons/lvmlockd/lvmlockd-core.c
abb29f
+++ b/daemons/lvmlockd/lvmlockd-core.c
abb29f
@@ -896,8 +896,9 @@ static int read_adopt_file(struct list_head *vg_lockd)
abb29f
 				goto fail;
abb29f
 
abb29f
 			memset(vg_uuid, 0, sizeof(vg_uuid));
abb29f
+			memset(lm_type_str, 0, sizeof(lm_type_str));
abb29f
 
abb29f
-			if (sscanf(adopt_line, "VG: %63s %64s %16s %64s",
abb29f
+			if (sscanf(adopt_line, "VG: %63s %64s %15s %64s",
abb29f
 				   vg_uuid, ls->vg_name, lm_type_str, ls->vg_args) != 4) {
abb29f
 				goto fail;
abb29f
 			}
abb29f
@@ -916,8 +917,9 @@ static int read_adopt_file(struct list_head *vg_lockd)
abb29f
 			r->type = LD_RT_LV;
abb29f
 
abb29f
 			memset(vg_uuid, 0, sizeof(vg_uuid));
abb29f
+			memset(mode, 0, sizeof(mode));
abb29f
 
abb29f
-			if (sscanf(adopt_line, "LV: %64s %64s %s %8s %u",
abb29f
+			if (sscanf(adopt_line, "LV: %64s %64s %s %7s %u",
abb29f
 				   vg_uuid, r->name, r->lv_args, mode, &r->version) != 5) {
abb29f
 				goto fail;
abb29f
 			}