linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] [PATCH] dmsetup: fix sscanf return check
@ 2012-08-23 13:31 Matthew Booth
  2012-08-23 20:01 ` Mark van Dijk
  2012-08-23 20:27 ` Alasdair G Kergon
  0 siblings, 2 replies; 4+ messages in thread
From: Matthew Booth @ 2012-08-23 13:31 UTC (permalink / raw)
  To: linux-lvm

---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-24  8:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23 13:31 [linux-lvm] [PATCH] dmsetup: fix sscanf return check Matthew Booth
2012-08-23 20:01 ` Mark van Dijk
2012-08-23 20:27 ` Alasdair G Kergon
2012-08-24  8:46   ` Matthew Booth

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).