1
Fork 0
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:
Ludovic Courtès 2013-11-13 14:24:42 +01:00
parent 36c4044007
commit 4a0fb276a9

View file

@ -1535,7 +1535,9 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
codeset = nl_langinfo (CODESET); codeset = nl_langinfo (CODESET);
} }
c_result = strdup (c_result); if (c_result != NULL)
c_result = strdup (c_result);
unlock_locale_mutex (); unlock_locale_mutex ();
if (c_result == NULL) if (c_result == NULL)