This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [review] manual: Clarify strnlen, wcsnlen, strndup null termination behavior
On Okt 30 2019, Zack Weinberg wrote:
> On Wed, Oct 30, 2019 at 12:20 PM Andreas Schwab <schwab@suse.de> wrote:
>> On Okt 30 2019, Zack Weinberg wrote:
>>
>> > It says that accesses beyond maxlen are forbidden, but it *doesn't*
>> > say that accesses beyond the first NUL are forbidden; therefore they
>> > are allowed.
>>
>> Neither does it say that about strncpy or strncat.
>
> I don't see why that would change anything.
That means that strncpy (x, "a", 10) is undefined.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
- References:
- [review] manual: Clarify strnlen, wcsnlen, strndup null termination behavior
- From: Florian Weimer (Code Review)
- Re: [review] manual: Clarify strnlen, wcsnlen, strndup null termination behavior
- Re: [review] manual: Clarify strnlen, wcsnlen, strndup null termination behavior
- Re: [review] manual: Clarify strnlen, wcsnlen, strndup null termination behavior
- Re: [review] manual: Clarify strnlen, wcsnlen, strndup null termination behavior
- Re: [review] manual: Clarify strnlen, wcsnlen, strndup null termination behavior
- Re: [review] manual: Clarify strnlen, wcsnlen, strndup null termination behavior
- Re: [review] manual: Clarify strnlen, wcsnlen, strndup null termination behavior
- Re: [review] manual: Clarify strnlen, wcsnlen, strndup null termination behavior