Mark H Weaver <m...@netris.org> skribis: > Mark H Weaver <m...@netris.org> writes: > >> l...@gnu.org (Ludovic Courtès) writes: >> >>> Eli Zaretskii <e...@gnu.org> skribis: >>> >>>> Sorry, that missed one more instance. Please use this patch instead. >>>> >>>> --- libguile/i18n.c~0 2014-08-08 17:05:57.262034100 +0300 >>>> +++ libguile/i18n.c 2014-08-10 17:20:52.073000000 +0300 >>>> @@ -1497,6 +1497,8 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinf >>>> { >>>> #ifdef USE_GNU_LOCALE_API >>>> c_result = nl_langinfo_l (c_item, c_locale); >>>> + if (c_result != NULL) >>>> + c_result = strdup (c_result); >>>> codeset = nl_langinfo_l (CODESET, c_locale); > > So, I think we have to copy 'codeset' also, because it is not used until > after the locale mutex is released, at which point another thread could > call 'nl_langinfo*' and overwrite the static buffer that 'codeset' > points to.
Indeed. > +static char * > +copy_string_or_null (char *s) const char *s Fine with me! Ludo’.