This is the mail archive of the
mailing list for the Cygwin project.
Re: wcsxfrm() with empty locale crashes the runtime
- From: Brian Inglis <Brian dot Inglis at SystematicSw dot ab dot ca>
- To: cygwin at cygwin dot com
- Date: Tue, 19 Mar 2019 14:50:57 -0600
- Subject: Re: wcsxfrm() with empty locale crashes the runtime
- References: <email@example.com>
- Reply-to: Brian dot Inglis at SystematicSw dot ab dot ca
On 2019-03-19 13:28, LRN wrote:
> The testcase is attached. Running it with Cygwin-i386 leads to a crash. My
> guess is that the implementation is not POSIX-conformant and tries to
> dereference the first argument (NULL), even though the third argument is 0.
> Tested with Cygwin-3.0.4.
$ man wcsxfrm
If n is 0, stra may be a NULL pointer.
(NOT Cygwin:) The current implementation of wcsxfrm simply uses wcslcpy
and does not support any language-specific transformations.
As wcslcpy is a BSD extension, any expectations are excessive; OpenBSD says:
"Also note that wcslcpy() and wcslcat() only operate on wide strings that are
terminated with a null wide character (L'\0'). This means that for wcslcpy() src
must be terminated with a null wide character..."
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple