4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-09 18:49:11 +08:00
Corinna Vinschen 85be74f295 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:26 +02:00
..
2017-12-01 03:41:50 -06:00
2017-12-01 03:41:50 -06:00
2018-01-17 11:47:26 -06:00
2022-07-13 06:55:46 +02:00
2022-07-13 06:55:46 +02:00