mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
i18n: Fix null pointer dereference when locale info is missing.
* libguile/i18n.c (scm_nl_langinfo): Check whether C_RESULT is NULL before calling 'strdup'.
This commit is contained in:
parent
36c4044007
commit
4a0fb276a9
1 changed files with 3 additions and 1 deletions
|
@ -1535,7 +1535,9 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
|
||||||
codeset = nl_langinfo (CODESET);
|
codeset = nl_langinfo (CODESET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (c_result != NULL)
|
||||||
c_result = strdup (c_result);
|
c_result = strdup (c_result);
|
||||||
|
|
||||||
unlock_locale_mutex ();
|
unlock_locale_mutex ();
|
||||||
|
|
||||||
if (c_result == NULL)
|
if (c_result == NULL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue