dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [PATCH] libmultipath: fix snprintf buffer overflows
@ 2010-11-28 21:12 Tim Harder
  2010-11-28 21:24 ` Christophe Varoqui
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Harder @ 2010-11-28 21:12 UTC (permalink / raw)
  To: dm-devel

[-- Attachment #1: Type: text/plain, Size: 134 bytes --]

Hi,

I've attached a patch against the latest git version of multipath-tools
to fix a couple snprintf buffer overflows. 

Thanks,
Tim

[-- Attachment #2: 0001-libmultipath-fix-snprintf-buffer-overflows.patch --]
[-- Type: text/plain, Size: 1469 bytes --]

From 2d51194853342ba24f3b76e9343b8467a8e55400 Mon Sep 17 00:00:00 2001
From: Tim Harder <radhermit@gentoo.org>
Date: Sun, 28 Nov 2010 12:37:08 -0800
Subject: [PATCH] libmultipath: fix snprintf buffer overflows

---
 libmultipath/prioritizers/datacore.c |    2 +-
 libmultipath/prioritizers/hds.c      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libmultipath/prioritizers/datacore.c b/libmultipath/prioritizers/datacore.c
index 6b7b202..2c16c6c 100644
--- a/libmultipath/prioritizers/datacore.c
+++ b/libmultipath/prioritizers/datacore.c
@@ -94,7 +94,7 @@ int datacore_prio (const char *dev, int sg_fd, char * args)
 	if ((io_hdr.info & SG_INFO_OK_MASK) != SG_INFO_OK)
 		return 0;
 
-	snprintf(vendor, 9, "%.8s\n", inqBuffp + 8);
+	snprintf(vendor, 8, "%.8s\n", inqBuffp + 8);
 	snprintf(product, 17, "%.16s", inqBuffp + 16);
 	snprintf(luname, 21, "%.19s", inqBuffp + 36);
 	snprintf(wwpn, 17, "%.16s", inqBuffp + 96);
diff --git a/libmultipath/prioritizers/hds.c b/libmultipath/prioritizers/hds.c
index 7b354b2..4789340 100644
--- a/libmultipath/prioritizers/hds.c
+++ b/libmultipath/prioritizers/hds.c
@@ -123,7 +123,7 @@ int hds_modular_prio (const char *dev, int fd)
 		return -1;
 	}
 
-	snprintf (vendor, 9, "%.8s", inqBuffp + 8);
+	snprintf (vendor, 8, "%.8s", inqBuffp + 8);
 	snprintf (product, 17, "%.16s", inqBuffp + 16);
 	snprintf (serial, 5, "%.4s", inqBuffp + 40);
 	snprintf (ldev, 5, "%.4s", inqBuffp + 44);
-- 
1.7.3.2


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] libmultipath: fix snprintf buffer overflows
  2010-11-28 21:12 [PATCH] libmultipath: fix snprintf buffer overflows Tim Harder
@ 2010-11-28 21:24 ` Christophe Varoqui
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe Varoqui @ 2010-11-28 21:24 UTC (permalink / raw)
  To: Tim Harder; +Cc: dm-devel

On dim., 2010-11-28 at 13:12 -0800, Tim Harder wrote:
> Hi,
> 
> I've attached a patch against the latest git version of multipath-tools
> to fix a couple snprintf buffer overflows. 
> 

Thanks,
applied.

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

end of thread, other threads:[~2010-11-28 21:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-28 21:12 [PATCH] libmultipath: fix snprintf buffer overflows Tim Harder
2010-11-28 21:24 ` Christophe Varoqui

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