basexmlformatter: Do not allow empty file loading

This commit is contained in:
Thibault Saunier 2013-04-30 18:26:57 +01:00
parent 602f49f3e1
commit 51403f65be

View file

@ -142,6 +142,9 @@ create_parser_context (GESBaseXmlFormatter * self, const gchar * uri,
if (!g_file_load_contents (file, NULL, &xmlcontent, &xmlsize, NULL, &err)) if (!g_file_load_contents (file, NULL, &xmlcontent, &xmlsize, NULL, &err))
goto failed; goto failed;
if (g_strcmp0 (xmlcontent, "") == 0)
goto failed;
parsecontext = g_markup_parse_context_new (&self_class->content_parser, parsecontext = g_markup_parse_context_new (&self_class->content_parser,
G_MARKUP_TREAT_CDATA_AS_TEXT, self, NULL); G_MARKUP_TREAT_CDATA_AS_TEXT, self, NULL);