From: Eric Sesterhenn / Snakebyte <snakebyte@gmx.de>
To: Dmitry Torokhov <dtor@insightbb.com>
Cc: Eric Sesterhenn / Snakebyte <snakebyte@gmx.de>,
Henk Vergonet <Henk.Vergonet@gmail.com>,
"Randy.Dunlap" <rdunlap@xenotime.net>,
linux-kernel@vger.kernel.org
Subject: Re: [Patch] Off by one in drivers/usb/input/yealink.c
Date: Thu, 6 Jul 2006 16:41:06 +0200 [thread overview]
Message-ID: <20060706144106.GA8764@alice> (raw)
In-Reply-To: <200607052225.33352.dtor@insightbb.com>
* Dmitry Torokhov (dtor@insightbb.com) wrote:
> On Wednesday 05 July 2006 20:49, Eric Sesterhenn / Snakebyte wrote:
> > I looked at this code several times too, and tried to reproduce the bug
> > with the following little program:
> >
> > #include <string.h>
> > int main(int argc, char **argv) {
> > char foo[] = "abcdef";
> > int i = 0;
> >
> > foo[strlen(foo)] = 'X';
> > do {
> > putchar(foo[i]);
> > } while (++i < sizeof(foo));
> > }
> >
> > Which clearly shows that the terminating '\0' gets printed too,
> > replaced by the X for better visibility, so the code
> > runs past the array, or did I fail to replicate the original
> > code somewhere?
> >
>
> What do you mean "the code runs past the array"? The size of array is 7
> (compiler allocates the space for terminating '\0') and the array is
> printed in its entirety.
arg, of course \0 is part of the array, sorry bothering you guys
with this stuff :( Another coverity report i analyzed incorrect... :(
Eric
prev parent reply other threads:[~2006-07-06 14:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-27 22:41 [Patch] Off by one in drivers/usb/input/yealink.c Eric Sesterhenn
2006-06-27 22:51 ` Randy.Dunlap
2006-06-27 23:04 ` Eric Sesterhenn / Snakebyte
2006-06-27 23:18 ` Randy.Dunlap
2006-06-27 23:26 ` Eric Sesterhenn
2006-07-05 13:02 ` Henk Vergonet
[not found] ` <d120d5000607050655o44cb66c3s7616493c7507d4d8@mail.gmail.com>
2006-07-06 0:49 ` Eric Sesterhenn / Snakebyte
2006-07-06 2:25 ` Dmitry Torokhov
2006-07-06 14:41 ` Eric Sesterhenn / Snakebyte [this message]
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=20060706144106.GA8764@alice \
--to=snakebyte@gmx.de \
--cc=Henk.Vergonet@gmail.com \
--cc=dtor@insightbb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@xenotime.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.