From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/165 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?THVrYSBNYXLEjWV0acSH?= Newsgroups: gmane.linux.lib.musl.general Subject: Re: cluts: strerror_r() test Date: Thu, 14 Jul 2011 21:35:06 +0200 Message-ID: <4E1F44EA.5080309@gmail.com> References: <4E125DBC.9090809@gmail.com> <4E131E8F.9@gmail.com> <4E14C55E.6030808@gmail.com> <4E16141F.5060303@gmail.com> <4E17877E.30907@gmail.com> <20110709115301.GA6510@openwall.com> <20110710145201.GB133@brightrain.aerifal.cx> <4E1B8041.1050602@gmail.com> <20110714095730.GF27991@openwall.com> <4E1EC7DF.3070202@gmail.com> <20110714175509.GK16618@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1310672212 3895 80.91.229.12 (14 Jul 2011 19:36:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 14 Jul 2011 19:36:52 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-249-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jul 14 21:36:48 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QhRiJ-0003fd-Ul for gllmg-musl@lo.gmane.org; Thu, 14 Jul 2011 21:36:48 +0200 Original-Received: (qmail 32761 invoked by uid 550); 14 Jul 2011 19:36:47 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32753 invoked from network); 14 Jul 2011 19:36:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=IIWC0u8aZil5QZnotr9kr2EyGdAx9sSYwiRfz89OhV4=; b=JEubD7/aty4fn3vqWitN+inw97D3ZpeDuYU5mSAv+fHHTaeaIIvj3+bWSu4SRzGoq1 gITygQdqpwqYeUbBE2kSp7jY8naS0sgD0A2QHG+0ROCN+czEOtEgk5F1KkEdvbRiEJJZ 8f9mgVNWLbF0wE4BaFm02iRsOzNz8LqKAkDq4= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110626 Icedove/3.1.11 In-Reply-To: <20110714175509.GK16618@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:165 Archived-At: On 07/14/2011 07:55 PM, Rich Felker wrote: > On Thu, Jul 14, 2011 at 12:41:35PM +0200, Luka Marčetić wrote: >> one). Strerror_r implementations are free to redirect a passed >> pointer to immutable memory if size(buflen) argument is sufficiently > I don't see how this can be. [...] Neither does the standard, ##C lied to me ;-) >> large. Of course, wanting to write to s[size-1] would SIGSEGV in > Actually it would probably just corrupt malloc data structures and > lead to havoc much later in the program. To test you could use a trick > like the string function tests, but that's really overkill. Just > allocating a buffer that's large enough, pre-filling it with an > unusual value, and calling the function with a shorter length > parameter should work. Then you can check that none of the fill bytes > were clobbered past the allowed length. > > I hope this makes sense... Unfortunately, no, I don't get any of it.