From f33f9361086db3cf1d09cec067f38fe751ed22eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 2 Jul 2007 14:59:11 -0400 Subject: Fix crash when no attributes are present for symlink. --- src/fontfile/catalogue.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/fontfile/catalogue.c b/src/fontfile/catalogue.c index 6d364a5..812b050 100644 --- a/src/fontfile/catalogue.c +++ b/src/fontfile/catalogue.c @@ -81,8 +81,13 @@ ComparePriority(const void *p1, const void *p2) { FontDirectoryPtr dir1 = (*(FontPathElementPtr*) p1)->private; FontDirectoryPtr dir2 = (*(FontPathElementPtr*) p2)->private; - const char *pri1 = strstr(dir1->attributes, PriorityAttribute); - const char *pri2 = strstr(dir2->attributes, PriorityAttribute); + const char *pri1 = NULL; + const char *pri2 = NULL; + + if (dir1->attributes != NULL) + pri1 = strstr(dir1->attributes, PriorityAttribute); + if (dir2->attributes != NULL) + pri2 = strstr(dir2->attributes, PriorityAttribute); if (pri1 == NULL && pri2 == NULL) return 0; -- cgit v1.2.3