From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79876 invoked by alias); 30 Oct 2019 16:47:24 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 79865 invoked by uid 89); 30 Oct 2019 16:47:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:733 X-HELO: mx1.suse.de From: Andreas Schwab To: Zack Weinberg Cc: Florian Weimer , GNU C Library Subject: Re: [review] manual: Clarify strnlen, wcsnlen, strndup null termination behavior References: <87a79i33kt.fsf@oldenburg2.str.redhat.com> <875zk6337v.fsf@oldenburg2.str.redhat.com> X-Yow: I'm mentally OVERDRAWN! What's that SIGNPOST up ahead? Where's ROD STERLING when you really need him? Date: Wed, 30 Oct 2019 16:47:00 -0000 In-Reply-To: (Zack Weinberg's message of "Wed, 30 Oct 2019 12:30:51 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-10/txt/msg00931.txt.bz2 On Okt 30 2019, Zack Weinberg wrote: > On Wed, Oct 30, 2019 at 12:20 PM Andreas Schwab 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."