mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 2 years ago
Clone

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

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