mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 2 years ago
Clone

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

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