From a18ca17b6211f62fbd1d893811b94b8c83db4cc0 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Tue, 21 Feb 2012 15:29:56 +0900 Subject: Bug 40452 - Running 'fc-match --all' core dumps when no fonts are installed This would changes the behavior of FcFontSort(). it won't returns NULL afterward. --- fc-match/fc-match.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fc-match') diff --git a/fc-match/fc-match.c b/fc-match/fc-match.c index e64b4bc..095dd4e 100644 --- a/fc-match/fc-match.c +++ b/fc-match/fc-match.c @@ -175,6 +175,11 @@ main (int argc, char **argv) int j; font_patterns = FcFontSort (0, pat, all ? FcFalse : FcTrue, 0, &result); + if (!font_patterns || font_patterns->nfont == 0) + { + fputs("No fonts installed on the system\n", stderr); + return 1; + } for (j = 0; j < font_patterns->nfont; j++) { FcPattern *font_pattern; -- cgit v1.2.3