* [PATCH] fix cu3088 group write
@ 2003-08-19 16:32 Guillaume Morin
2003-08-25 14:00 ` [PATCH resend #1] " Guillaume Morin
0 siblings, 1 reply; 2+ messages in thread
From: Guillaume Morin @ 2003-08-19 16:32 UTC (permalink / raw)
To: torvalds; +Cc: arndb, linux-kernel
Hi Linus,
The current cu3088 ccwgroup write code overwrite the last char of the
given arguments. This patch fixes the problem :
--- linux-2.6.0-test3-bk6.orig/drivers/s390/net/cu3088.c 2003-08-19 16:19:32.000000000 +0000
+++ linux-2.6.0-test3-bk6/drivers/s390/net/cu3088.c 2003-08-19 16:22:46.000000000 +0000
@@ -64,7 +64,7 @@
group_write(struct device_driver *drv, const char *buf, size_t count)
{
const char *start, *end;
- char bus_ids[2][BUS_ID_SIZE], *argv[2];
+ char bus_ids[2][BUS_ID_SIZE+1], *argv[2];
int i;
int ret;
struct ccwgroup_driver *cdrv;
@@ -79,7 +79,7 @@
if (!(end = strchr(start, delim[i])))
return count;
- len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start);
+ len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start)+1;
strlcpy (bus_ids[i], start, len);
argv[i] = bus_ids[i];
start = end + 1;
memcpy is not an option since the string will be used with strncmp with
a length > BUS_ID_SIZE.
Please apply.
--
Guillaume Morin <guillaume@morinfr.org>
Build a man a fire, and he'll be warm for a day. Set a man on fire,
and he'll be warm for the rest of his life. (Terry Pratchett)
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH resend #1] fix cu3088 group write
2003-08-19 16:32 [PATCH] fix cu3088 group write Guillaume Morin
@ 2003-08-25 14:00 ` Guillaume Morin
0 siblings, 0 replies; 2+ messages in thread
From: Guillaume Morin @ 2003-08-25 14:00 UTC (permalink / raw)
To: torvalds, akpm; +Cc: linux-kernel
Hi Linus, Andrew
The current cu3088 ccwgroup write code overwrite the last char of the
given arguments. This following patch fixes the problem. It is been
tested and applies on latest bk.
--- linux-2.6.0-test3-bk6.orig/drivers/s390/net/cu3088.c 2003-08-19 16:19:32.000000000 +0000
+++ linux-2.6.0-test3-bk6/drivers/s390/net/cu3088.c 2003-08-19 16:22:46.000000000 +0000
@@ -64,7 +64,7 @@
group_write(struct device_driver *drv, const char *buf, size_t count)
{
const char *start, *end;
- char bus_ids[2][BUS_ID_SIZE], *argv[2];
+ char bus_ids[2][BUS_ID_SIZE+1], *argv[2];
int i;
int ret;
struct ccwgroup_driver *cdrv;
@@ -79,7 +79,7 @@
if (!(end = strchr(start, delim[i])))
return count;
- len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start);
+ len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start)+1;
strlcpy (bus_ids[i], start, len);
argv[i] = bus_ids[i];
start = end + 1;
memcpy is not an option since the string will be used with strncmp with
a length > BUS_ID_SIZE.
Please apply.
--
Guillaume Morin <guillaume@morinfr.org>
Build a man a fire, and he'll be warm for a day. Set a man on fire,
and he'll be warm for the rest of his life. (Terry Pratchett)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-08-25 14:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-19 16:32 [PATCH] fix cu3088 group write Guillaume Morin
2003-08-25 14:00 ` [PATCH resend #1] " Guillaume Morin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®