This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [COMMITTED] Fix off-by-one bug in tst-fwrite-error
- From: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Siddhesh Poyarekar <siddhesh at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 15 Apr 2013 14:11:12 +0530
- Subject: Re: [COMMITTED] Fix off-by-one bug in tst-fwrite-error
- References: <20130415060928 dot GJ9444 at spoyarek dot pnq dot redhat dot com> <mvmfvysw8xp dot fsf at hawking dot suse dot de> <CAAHN_R0YavvV6vEk0w=T=JS0Wy8ZYYNE6iCPegLk2F-QDd-0Fw at mail dot gmail dot com> <mvm38usw66u dot fsf at hawking dot suse dot de>
On 15 April 2013 13:56, Andreas Schwab <schwab@suse.de> wrote:
> Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com> writes:
> There is no NUL terminator.
>
OK, I did not know this and assumed (incorrectly) that this will
silently overflow:
"An array of character type may be initialized by a character string
literal, optionally enclosed in braces. Successive characters of the
character string literal (including the terminating null character if
there is room or if the array is of unknown size) initialize the
members of the array."
I'll keep the commit if it's OK, since it's a harmless change.
Thanks,
Siddhesh
--
http://siddhesh.in