diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-05-09 12:36:30 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-05-09 12:36:47 -0700 |
commit | 0f9db4aa7de6e0644ac9c5811b949e5f936c9d61 (patch) | |
tree | c6859b2f67184399474a6d325855f6ebdcdb1225 | |
parent | 67311922a2e02d8a763831831b65bb4833db58b5 (diff) |
Don't allow a font alias to point to itself and create a loop
Part of fix for Sun bug 4258475
<http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4258475>
-rw-r--r-- | src/fontfile/fontdir.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fontfile/fontdir.c b/src/fontfile/fontdir.c index cf68a54..cd9fde1 100644 --- a/src/fontfile/fontdir.c +++ b/src/fontfile/fontdir.c @@ -811,6 +811,10 @@ FontFileAddFontAlias (FontDirectoryPtr dir, char *aliasName, char *fontName) { FontEntryRec entry; + if (strcmp(aliasName,fontName) == 0) { + /* Don't allow an alias to point to itself and create a loop */ + return FALSE; + } entry.name.length = strlen (aliasName); CopyISOLatin1Lowered (aliasName, aliasName, entry.name.length); entry.name.name = aliasName; |