From: Guillaume Morin <guillaume@morinfr.org>
To: torvalds@osdl.org
Cc: arndb@de.ibm.com, linux-kernel@vger.kernel.org
Subject: [PATCH] fix cu3088 group write
Date: Tue, 19 Aug 2003 12:32:59 -0400 [thread overview]
Message-ID: <20030819163257.GA3316@siri.morinfr.org> (raw)
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)
next reply other threads:[~2003-08-19 17:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-19 16:32 Guillaume Morin [this message]
2003-08-25 14:00 ` [PATCH resend #1] fix cu3088 group write Guillaume Morin
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=20030819163257.GA3316@siri.morinfr.org \
--to=guillaume@morinfr.org \
--cc=arndb@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/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