From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] implement a private state for the uchar.h functions
Date: Sat, 15 Nov 2014 12:29:14 -0500 [thread overview]
Message-ID: <20141115172914.GN22465@brightrain.aerifal.cx> (raw)
In-Reply-To: <1415528228.2457.1188.camel@eris.loria.fr>
On Sun, Nov 09, 2014 at 11:18:08AM +0100, Jens Gustedt wrote:
> The C standard is imperative on that:
>
> 7.28.1 ... If ps is a null pointer, each function uses its own internal
> mbstate_t object instead, which is initialized at program startup to
> the initial conversion state;
>
> and these functions are also not supposed to implicitly use the state of
> the wchar.h functions:
>
> 7.29.6.3 ... The implementation behaves as if no library function calls
> these functions with a null pointer for ps.
>
> Previously this resulted in two bugs.
>
> - The functions c16rtomb and mbrtoc16 would crash when called with ps
> set to null.
>
> - The functions c32rtomb and mbrtoc32 used the private states of wcrtomb
> and mbrtowc, respectively, which they are not allowed to do.
One small correction: wcrtomb has no state, and c32rtomb does not need
any either.
Rich
next prev parent reply other threads:[~2014-11-15 17:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-09 10:18 Jens Gustedt
2014-11-11 3:21 ` Rich Felker
2014-11-11 13:53 ` Jens Gustedt
2014-11-11 14:39 ` Rich Felker
2014-11-11 16:03 ` Jens Gustedt
2014-11-15 17:29 ` Rich Felker [this message]
2014-11-15 17:57 ` Jens Gustedt
2014-11-15 20:10 ` Rich Felker
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=20141115172914.GN22465@brightrain.aerifal.cx \
--to=dalias@libc.org \
--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).