newlib-cygwin/newlib/libc
Corinna Vinschen b612db5b14 newlocale: fix crash when trying to write to __C_locale
This simple testcase:

  locale_t st = newlocale(LC_ALL_MASK, "C", (locale_t)0);
  locale_t st2 = newlocale(LC_CTYPE_MASK, "en_US.UTF-8", st);

is sufficient to reproduce a crash in _newlocale_r.  After the first call
to newlocale, `st' points to __C_locale, which is const.  When using `st'
as locale base in the second call, _newlocale_r tries to set pointers
inside base to NULL.  This is bad if base is __C_locale, obviously.

Add a test to avoid trying to overwrite pointer values inside base if
base is __C_locale.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-12 12:29:41 +02:00
..
argz Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
ctype fix and amend scripts and makefile rules to generate Unicode data 2021-07-06 15:35:37 +02:00
errno Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
iconv Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
include stdio: Fix issue of printing "%La" format with large exp part. 2021-11-29 23:14:12 +09:00
locale newlocale: fix crash when trying to write to __C_locale 2022-08-12 12:29:41 +02:00
machine libgloss/newlib: rename configure.in to configure.ac 2021-09-13 10:14:37 -04:00
misc Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
posix posix_spawn: fix get/set uid/gid calls for 32 bit Cygwin 2022-01-12 11:57:53 +01:00
reent Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
search Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
signal newlib: sig2str: use __restrict 2021-09-15 10:08:20 -04:00
ssp Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
stdio stdio: Fix issue of printing "%La" format with large exp part. 2021-11-29 23:14:12 +09:00
stdio64 Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
stdlib ldtoa: Fix insufficient valid output digits for "%f" format. 2021-11-26 06:47:27 +09:00
string string: Fix buffer overrun in picolibc/newlib/libc/string/strrchr.c (#184) 2021-10-13 16:39:49 -04:00
sys libgloss/newlib: rename configure.in to configure.ac 2021-09-13 10:14:37 -04:00
syscalls Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
time Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
unix Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
xdr Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
Makefile.am ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
Makefile.in Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
Makefile.unidata fix and amend scripts and makefile rules to generate Unicode data 2021-07-06 15:35:37 +02:00
aclocal.m4 Fix up errors in regenerated files for 2.3.0 release. 2016-01-04 12:57:31 -05:00
configure Add build mechanism to share common header files between machines 2021-04-13 12:55:33 +02:00
configure.ac libgloss/newlib: rename configure.in to configure.ac 2021-09-13 10:14:37 -04:00
libc.in.xml ssp: add documentation 2017-11-29 11:25:45 -06:00
libc.texinfo ssp: add documentation 2017-11-29 11:25:45 -06:00
saber Remove matherr, and SVID and X/Open math library configurations 2019-01-23 10:46:24 +01:00
sys.tex Don't include stdio64 functions in reentrant syscalls menu when not bulding stdio64. 2015-08-03 09:54:33 +01:00