This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Buffer overwrite in libstdc++-v3 test 21_strings/c_strings.c
- To: garsh at home dot com
- Subject: Re: Buffer overwrite in libstdc++-v3 test 21_strings/c_strings.c
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Date: Wed, 26 Sep 2001 16:05:38 +0200
- CC: libstdc++ at gcc dot gnu dot org, hans-peter dot nilsson at axis dot com
> Date: Wed, 26 Sep 2001 09:17:35 -0400 (EDT)
> From: Brad Garcia <garsh@home.com>
> On 24-Sep-2001 Hans-Peter Nilsson wrote:
(Some other guy wrote:)
> > > how do you fit 37 characters (i.e. strlen(ccarray1) + 1 for the null)
> > > into 30 char buffer (size of carray), without overflowing it ?
> >
> > That's the question I'm asking. But presumably some corner in
> > that pile of papers called a C++ standards document could
> > interpret to say that strcpy should "DWIM" here.
>
> I found nothing in the C++ standard that could be interpretted in
> such a way.
>
> Do you mind pointing out the confusing section?
If you couldn't tell, I didn't actually read through the
standard before writing that presumption. I just jumped to
conclusions based on this being a test-case and the obviousness
of the code. Anyway, it's over; the bug's been fixed (thanks
Phil!). Nothing to see here, move along, move along...
brgds, H-P