public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* wcsxfrm() with empty locale crashes the runtime
@ 2019-03-19 19:28 LRN
  2019-03-19 20:42 ` Corinna Vinschen
  2019-03-19 20:51 ` Brian Inglis
  0 siblings, 2 replies; 4+ messages in thread
From: LRN @ 2019-03-19 19:28 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1.1: Type: text/plain, Size: 253 bytes --]

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.

[-- Attachment #1.1.2: wcsxfrm_test.c --]
[-- Type: text/plain, Size: 180 bytes --]

#include <wchar.h>
#include <stdlib.h>
#include <locale.h>

int
main ()
{
  wchar_t w[2] = { L'z', L'\0' };
  setlocale (LC_ALL, "");
  int l = wcsxfrm (NULL, w, 0);
  return l;
}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-20  7:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19 19:28 wcsxfrm() with empty locale crashes the runtime LRN
2019-03-19 20:42 ` Corinna Vinschen
2019-03-20  7:18   ` LRN
2019-03-19 20:51 ` Brian Inglis

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 read-only IMAP folder(s) and NNTP newsgroup(s).