All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - lvmlockd: sscanf buffer size warnings
Date: Fri,  8 Jan 2021 18:13:20 +0000 (GMT)	[thread overview]
Message-ID: <20210108181320.91C1038438A3@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a4c56a3bc342ab42fdfc9c9538b3fa7feba49412
Commit:        a4c56a3bc342ab42fdfc9c9538b3fa7feba49412
Parent:        6308365d485a741d36c98060a00e95892fc3d21f
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Fri Jan 8 11:59:28 2021 -0600
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Fri Jan 8 12:13:05 2021 -0600

lvmlockd: sscanf buffer size warnings

---
 daemons/lvmlockd/lvmlockd-core.c | 6 ++++--
 1 file 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;
 			}



                 reply	other threads:[~2021-01-08 18:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210108181320.91C1038438A3@sourceware.org \
    --to=teigland@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.