From 1a01e96c6d15ef17a8b5ab1afa361fb12476a25e Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 9 May 2008 15:38:44 -0700 Subject: [PATCH] Return a valid X error when stuck in font alias loop Part of fix for Sun bug 4258475 --- dix/dixfonts.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) {