linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Matthew Booth <mbooth@redhat.com>
To: linux-lvm@redhat.com
Subject: [linux-lvm] [PATCH] dmsetup: fix sscanf return check
Date: Thu, 23 Aug 2012 14:31:02 +0100	[thread overview]
Message-ID: <1345728662-28052-1-git-send-email-mbooth@redhat.com> (raw)

---
 tools/dmsetup.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 0ac970f..65d17f8 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -228,8 +228,7 @@ static int _parse_line(struct dm_task *dmt, char *buffer, const char *file,
 	if (!*ptr || *ptr == '#')
 		return 1;
 
-	if (sscanf(ptr, "%llu %llu %s %n",
-		   &start, &size, ttype, &n) < 3) {
+	if (sscanf(ptr, "%llu %llu %s %n", &start, &size, ttype, &n) != 4) {
 		err("Invalid format on line %d of table %s", line, file);
 		return 0;
 	}
-- 
1.7.11.4

             reply	other threads:[~2012-08-23 13:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23 13:31 Matthew Booth [this message]
2012-08-23 20:01 ` [linux-lvm] [PATCH] dmsetup: fix sscanf return check Mark van Dijk
2012-08-23 20:27 ` Alasdair G Kergon
2012-08-24  8:46   ` Matthew Booth

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=1345728662-28052-1-git-send-email-mbooth@redhat.com \
    --to=mbooth@redhat.com \
    --cc=linux-lvm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).