Date: Thu, 14 Jul 2011 21:35:06 +0200 From: Luka Marčetić <paxcoder@...il.com> To: musl@...ts.openwall.com Subject: Re: cluts: strerror_r() test 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.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.