From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: cluts: strerror_r() test
Date: Thu, 14 Jul 2011 13:55:09 -0400 [thread overview]
Message-ID: <20110714175509.GK16618@brightrain.aerifal.cx> (raw)
In-Reply-To: <4E1EC7DF.3070202@gmail.com>
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. sterror_r (the correct standard function
not the GNU bastardization) has no way of returning a pointer to a
string. Due to the interface design, it must write into the provided
buffer. By the way, this is another reason _POSIX_C_SOURCE or
_XOPEN_SOURCE must be defined - glibc likes to give you nonstandard
GNU functions by default...
> 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...
Rich
next prev parent reply other threads:[~2011-07-14 17:55 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 0:41 Daily reports: Monday Luka Marčetić
2011-07-05 14:24 ` Daily reports: Tuesday Luka Marčetić
2011-07-06 20:28 ` Daily reports: Wednesday Luka Marčetić
2011-07-07 16:18 ` Szabolcs Nagy
2011-07-07 20:27 ` Luka Marčetić
2011-07-07 20:16 ` Daily reports: Thursday Luka Marčetić
2011-07-08 22:41 ` Daily reports: Friday Luka Marčetić
2011-07-09 1:12 ` Daily reports: Friday - cont Luka Marčetić
2011-07-09 1:38 ` Solar Designer
2011-07-09 11:53 ` Daily reports: Friday Solar Designer
2011-07-09 15:30 ` Luka Marčetić
2011-07-09 22:11 ` Luka Marčetić
2011-07-13 19:46 ` Solar Designer
2011-07-10 14:52 ` Daily reports: Friday (threaded setuid testing) Rich Felker
2011-07-11 22:59 ` Daily cluts reports Luka Marčetić
2011-07-14 9:57 ` cluts: strerror_r() test (was: Daily cluts reports) Solar Designer
2011-07-14 10:41 ` cluts: strerror_r() test Luka Marčetić
2011-07-14 10:47 ` Solar Designer
2011-07-14 17:55 ` Rich Felker [this message]
2011-07-14 19:35 ` Luka Marčetić
2011-07-15 0:09 ` Daily cluts reports Luka Marčetić
2011-07-15 22:47 ` Daily cluts reports - numeric, setuid, and mid-term evaluation Luka Marčetić
2011-07-15 23:51 ` Rich Felker
2011-07-17 0:37 ` Daily cluts reports - setuid reiteration Luka Marčetić
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110714175509.GK16618@brightrain.aerifal.cx \
--to=dalias@aerifal.cx \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).