summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2008-05-09 15:38:44 -0700
committerJeremy Huddleston <jeremy@yuffie.local>2009-02-24 22:25:21 -0800
commit5fc34f65f76e73002ba90969e6f75b00866e5752 (patch)
treeca563432169128881fefd31685c9925cd7de8091
parente8a45d97d3fef81bd4bff1b816d746a2cdf398a8 (diff)
Return a valid X error when stuck in font alias loop
Part of fix for Sun bug 4258475 <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4258475> (cherry picked from commit 1a01e96c6d15ef17a8b5ab1afa361fb12476a25e)
-rw-r--r--dix/dixfonts.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index e9a3f3963..6fb29de3a 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -302,8 +302,14 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
c->fontname = newname;
c->fnamelen = newlen;
c->current_fpe = 0;
- if (--aliascount <= 0)
+ if (--aliascount <= 0) {
+ /* We've tried resolving this alias 20 times, we're
+ * probably stuck in an infinite loop of aliases pointing
+ * to each other - time to take emergency exit!
+ */
+ err = BadImplementation;
break;
+ }
continue;
}
if (err == BadFontName) {