diff --git a/gio/gcontenttype.c b/gio/gcontenttype.c index d54f04202..8734e7f4b 100644 --- a/gio/gcontenttype.c +++ b/gio/gcontenttype.c @@ -1032,11 +1032,16 @@ read_tree_magic_from_directory (const gchar *prefix) match = parse_header (lines[i]); insert_match (match); } - else + else if (match != NULL) { matchlet = parse_match_line (lines[i], &depth); insert_matchlet (match, matchlet, depth); } + else + { + g_warning ("%s: header corrupt; skipping\n", filename); + break; + } } g_strfreev (lines);