blob: 590b92e18658f4b1a5ee270b1bbfb260bfdd1fca [file] [log] [blame]
Brad Bishopd89cb5f2019-04-10 09:02:41 -04001From ba6dbd6e61dbb3cc6ee6db9dd3a4f70cc18f706e Mon Sep 17 00:00:00 2001
2From: Nancy Durgin <nancy.durgin@artifex.com>
3Date: Thu, 14 Feb 2019 10:09:00 -0800
4Subject: [PATCH] Undef /odef in gs_init.ps
5
6Made a new temporary utility function in gs_cet.ps (.odef) to use instead
7of /odef. This makes it fine to undef odef with all the other operators in
8gs_init.ps
9
10This punts the bigger question of what to do with .makeoperator, but it
11doesn't make the situation any worse than it already was.
12
13CVE: CVE-2019-3835
14Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
15
16Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
17---
18 Resource/Init/gs_cet.ps | 10 ++++++++--
19 Resource/Init/gs_init.ps | 1 +
20 2 files changed, 9 insertions(+), 2 deletions(-)
21
22diff --git a/Resource/Init/gs_cet.ps b/Resource/Init/gs_cet.ps
23index 75534bb..dbc5c4e 100644
24--- a/Resource/Init/gs_cet.ps
25+++ b/Resource/Init/gs_cet.ps
26@@ -1,6 +1,10 @@
27 %!PS
28 % Set defaults for Ghostscript to match Adobe CPSI behaviour for CET
29
30+/.odef { % <name> <proc> odef -
31+ 1 index exch .makeoperator def
32+} bind def
33+
34 systemdict /product get (PhotoPRINT SE 5.0v2) readonly eq
35 {
36 (%END GS_CET) .skipeof
37@@ -93,8 +97,8 @@ userdict /.smoothness currentsmoothness put
38 } {
39 /setsmoothness .systemvar /typecheck signalerror
40 } ifelse
41-} bind odef
42-/currentsmoothness { userdict /.smoothness get } bind odef % for 09-55.PS, 09-57.PS .
43+} bind //.odef exec
44+/currentsmoothness { userdict /.smoothness get } bind //.odef exec % for 09-55.PS, 09-57.PS .
45
46 % slightly nasty hack to give consistent cluster results
47 /ofnfa systemdict /filenameforall get def
48@@ -113,6 +117,8 @@ userdict /.smoothness currentsmoothness put
49 } ifelse
50 ofnfa
51 } bind def
52+
53+currentdict /.odef undef
54 % end of slightly nasty hack to give consistent cluster results
55
56 //false 0 startjob pop % re-enter encapsulated mode
57diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps
58index e6b9cd2..80d9585 100644
59--- a/Resource/Init/gs_init.ps
60+++ b/Resource/Init/gs_init.ps
61@@ -2257,6 +2257,7 @@ SAFER { .setsafeglobal } if
62 /.systemvmSFD /.settrapparams /.currentsystemparams /.currentuserparams /.getsystemparam /.getuserparam /.setsystemparams /.setuserparams
63 /.checkpassword /.locale_to_utf8 /.currentglobal /.gcheck /.imagepath /.currentoutputdevice
64 /.type /.writecvs /.setSMask /.currentSMask /.needinput /.countexecstack /.execstack /.applypolicies
65+ /odef
66
67 % Used by a free user in the Library of Congress. Apparently this is used to
68 % draw a partial page, which is then filled in by the results of a barcode
69--
702.18.1
71