remove .forceput from /.charkeys

When loading Type 1 or Truetype fonts from disk,
we attempt to extend the glyph name table
to include all identifiable glyph names from the Adobe Glyph List.

In the case of Type 1 fonts,
the font itself (almost always) marks the CharStrings dictionary as read-only,
hence we have to use .forceput for that case.

But for Truetype fonts,
the CharStrings dictionary is created internally
and is not read-only until *after* we have fully populated it
(including the extended glyph names from the AGL),
hence there is no need for .forceput,
and no need to carry the security risk of using it.

Replace with regular put.
Origin: upstream, http://git.ghostscript.com/?p=ghostpdl.git;h=4859047
Forwarded: yes
Bug: http://bugs.ghostscript.com/show_bug.cgi?id=701841
Bug-Debian: https://bugs.debian.org/944760
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2019-14869
Last-Update: 2019-11-27

Gbp-Pq: Name 020191105~4859047.patch
This commit is contained in:
Chris Liddell 2022-05-13 23:18:20 +08:00 committed by openKylinBot
parent 3ea75d0746
commit 4d6015e1ae
1 changed files with 4 additions and 4 deletions

View File

@ -1304,7 +1304,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef
TTFDEBUG { (\n1 setting alias: ) print dup ==only
( to be the same as ) print 2 index //== exec } if
7 index 2 index 3 -1 roll exch .forceput
7 index 2 index 3 -1 roll exch put
} forall
pop pop pop
}
@ -1322,7 +1322,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef
exch pop
TTFDEBUG { (\n2 setting alias: ) print 1 index ==only
( to use glyph index: ) print dup //== exec } if
5 index 3 1 roll .forceput
5 index 3 1 roll put
//false
}
{
@ -1339,7 +1339,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef
{ % CharStrings(dict) isunicode(boolean) cmap(dict) RAGL(dict) gname(name) codep(integer) gindex(integer)
TTFDEBUG { (\3 nsetting alias: ) print 1 index ==only
( to be index: ) print dup //== exec } if
exch pop 5 index 3 1 roll .forceput
exch pop 5 index 3 1 roll put
}
{
pop pop
@ -1369,7 +1369,7 @@ currentdict /.pickcmap_with_no_xlatmap .undef
} ifelse
]
TTFDEBUG { (Encoding: ) print dup === flush } if
} .bind executeonly odef % hides .forceput
} .bind odef
% ---------------- CIDFontType 2 font loading ---------------- %