gtk-module: check for zero length data from FcNameUnparse to mitigate fd#22792

This commit is contained in:
Richard Hughes 2009-07-16 09:08:40 +01:00
parent 2bce32ae48
commit ce49f887b8

View File

@ -172,13 +172,19 @@ pk_font_not_found (PangoLanguage *language)
/* convert to language */
lang = pango_language_to_string (language);
if (lang == NULL || lang[0] == '\0') {
g_warning ("failed to convert language to string");
goto out;
}
/* create the font tag used in as a package provides */
pat = FcPatternCreate ();
FcPatternAddString (pat, FC_LANG, (FcChar8 *) lang);
tag = (gchar *) FcNameUnparse (pat);
if (tag == NULL)
if (tag == NULL || tag[0] == '\0') {
g_warning ("failed to create font tag: %s", lang);
goto out;
}
/* add to array for processing in idle callback */
queue_install_fonts_tag (tag);