mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 22:16:16 +01:00
Protect against strcmp() on NULL strings
This commit is contained in:
parent
fca30c3e16
commit
058fa6393e
@ -335,10 +335,11 @@ _g_dgettext_should_translate (void)
|
|||||||
* - If locale is "C", maybe user calls setlocale(LC_ALL,"") later.
|
* - If locale is "C", maybe user calls setlocale(LC_ALL,"") later.
|
||||||
* Continue with old behavior of translating.
|
* Continue with old behavior of translating.
|
||||||
*/
|
*/
|
||||||
if (0 != strcmp (default_domain, "messages") &&
|
if (!default_domain || !translator_comment || !translate_locale ||
|
||||||
|
(0 != strcmp (default_domain, "messages") &&
|
||||||
'\0' == *translator_comment &&
|
'\0' == *translator_comment &&
|
||||||
0 != strncmp (translate_locale, "en_", 3) &&
|
0 != strncmp (translate_locale, "en_", 3) &&
|
||||||
0 != strcmp (translate_locale, "C"))
|
0 != strcmp (translate_locale, "C")))
|
||||||
should_translate = FALSE;
|
should_translate = FALSE;
|
||||||
|
|
||||||
g_once_init_leave (&translate,
|
g_once_init_leave (&translate,
|
||||||
|
Loading…
Reference in New Issue
Block a user