From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - cov: check sscanf result
Date: Sat, 12 Sep 2020 11:24:47 +0000 (GMT) [thread overview]
Message-ID: <20200912112447.D3A59383F86C@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=740d5bf6cd39015aac086ddca98a089ba6028d72
Commit: 740d5bf6cd39015aac086ddca98a089ba6028d72
Parent: a5d45b237dbb6d9c1984fd98ba84bce9bde0ea99
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Sat Sep 12 13:03:07 2020 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Sat Sep 12 13:24:03 2020 +0200
cov: check sscanf result
---
daemons/lvmlockd/lvmlockd-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c
index a0803de39..fea8ee6cf 100644
--- a/daemons/lvmlockd/lvmlockd-core.c
+++ b/daemons/lvmlockd/lvmlockd-core.c
@@ -887,8 +887,8 @@ static int read_adopt_file(struct list_head *vg_lockd)
continue;
else if (!strncmp(adopt_line, "lvmlockd", 8)) {
unsigned int v_major = 0, v_minor = 0;
- sscanf(adopt_line, "lvmlockd adopt_version %u.%u", &v_major, &v_minor);
- if (v_major != ADOPT_VERSION_MAJOR)
+ if ((sscanf(adopt_line, "lvmlockd adopt_version %u.%u", &v_major, &v_minor) != 2) ||
+ (v_major != ADOPT_VERSION_MAJOR))
goto fail;
} else if (!strncmp(adopt_line, "VG:", 3)) {
reply other threads:[~2020-09-12 11:24 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=20200912112447.D3A59383F86C@sourceware.org \
--to=zkabelac@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.