summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-07-02 14:59:11 -0400
committerKristian Høgsberg <krh@redhat.com>2007-07-02 14:59:11 -0400
commitf33f9361086db3cf1d09cec067f38fe751ed22eb (patch)
tree259ca736781cc16f0498efedc44558b2bfbd18af
parent8d47483711be6076e7bfefab14aa890c5f37e1aa (diff)
Fix crash when no attributes are present for symlink.
-rw-r--r--src/fontfile/catalogue.c9
1 files 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;