ff3989bd07765ea8a46c55a4480b3ae2bb26c661
[git/cygwin-packages/emacs-auctex.git] / runandhide.patch
1 commit 837d590008c1dd4e92ffbce15008efb761d11f7c
2 Author: David Kastrup <dak@gnu.org>
3 Date: Mon Nov 6 23:58:23 2017 +0100
4
5 Remove use of .runandhide operator
6
7 Ghostscript bug 698680
8 <https://bugs.ghostscript.com/show_bug.cgi?id=698680> has been caused
9 by the removal of the .runandhide operator in Ghostscript 9.22
10 upstream. Since .runandhide has no longer been used in a
11 security-critical manner, its operation can be emulated by storing the
12 respective information in a .preview-ST variable. Potentially
13 malicious code would not be able to retrieve a non-safe "save" object
14 from here.
15
16 diff --git a/preview.el.in b/preview.el.in
17 index d1137215..66853412 100644
18 --- a/preview.el.in
19 +++ b/preview.el.in
20 @@ -738,10 +738,10 @@ SETUP may contain a parser setup function."
21 null eq{pop{pop}bind}if def\
22 <</BeginPage{currentpagedevice/PageSize get dup 0 get 1 ne exch 1 get 1 ne or\
23 {.preview-BP %s}{pop}ifelse}bind/PageSize[1 1]>>setpagedevice\
24 -/preview-do{[count 3 roll save]3 1 roll dup length 0 eq\
25 -{pop}{setpagedevice}{ifelse .runandhide}\
26 +/preview-do{/.preview-ST[count 4 roll save]def dup length 0 eq\
27 +{pop}{setpagedevice}{ifelse exec}\
28 stopped{handleerror quit}if \
29 -aload pop restore}bind def "
30 +.preview-ST aload pop restore}bind def "
31 (preview-gs-color-string preview-colors)))
32 (preview-gs-queue-empty)
33 (preview-parse-messages (or setup #'preview-gs-dvips-process-setup))))
34 @@ -1090,7 +1090,7 @@ NONREL is not NIL."
35 .locksafe} stopped pop "
36 (mapconcat 'preview-ps-quote-filename all-files ""))
37 preview-gs-init-string
38 - (format "[%s(r)file]aload exch %s .runandhide aload pop "
39 + (format " %s(r)file /.preview-ST 1 index def %s exec .preview-ST "
40 (preview-ps-quote-filename file)
41 (preview-gs-dsc-cvx 0 preview-gs-dsc))))))
42
This page took 0.0395 seconds and 4 git commands to generate.