4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-20 13:29:24 +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
..
2019-02-19 14:34:18 -06:00
2019-03-04 14:14:15 +01:00
2019-03-08 12:57:42 +01:00
2019-04-30 18:49:23 +02:00
2019-12-18 10:47:43 +01:00
2019-12-21 11:44:08 +01:00
2020-02-18 11:35:42 +01:00
2020-05-28 13:34:19 -04:00
2021-10-26 18:47:22 +02:00
2021-11-23 01:19:56 +09:00