diff options
author | Alex Cherepanov <alex.cherepanov@artifex.com> | 2009-08-14 04:12:58 +0000 |
---|---|---|
committer | Alex Cherepanov <alex.cherepanov@artifex.com> | 2009-08-14 04:12:58 +0000 |
commit | 02e4d163028d453cd37d99f8c9df91b6f6424dd5 (patch) | |
tree | c9b03bf111c277d61be314a262a0da3fd9e2616d /gs/base/seexec.c | |
parent | f2d368f0d875b57a8f3ae402e75d153bdd5d4a2e (diff) |
Remove code that tries to pause at the end of the .PFB binary data in an
attempt to keep from reading beyond the end of the encrypted data, sometimes
misidentifying the end of the actual data, and stopping early. Bug 465936.
DETAILS:
Since the eexec operator specifies that one never reads more than 256 bytes
ahead, and since the pad bytes are given in the text portion of a .PFB file,
in hexadecimal, there is no need to go to extra lengths to avoid reading
(too far) past the end of the eexec data. Thanks to Paul Vojta and Ray
Johnston for the path.
DIFFERENCES:
None.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@9992 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/base/seexec.c')
-rw-r--r-- | gs/base/seexec.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/gs/base/seexec.c b/gs/base/seexec.c index 9f0e1431b..58e53cc1a 100644 --- a/gs/base/seexec.c +++ b/gs/base/seexec.c @@ -67,7 +67,6 @@ s_exD_set_defaults(stream_state * st) ss->binary = -1; /* unknown */ ss->lenIV = 4; - ss->record_left = max_long; ss->hex_left = max_long; /* Clear pointers for GC */ ss->pfb_state = 0; @@ -139,25 +138,17 @@ s_exD_process(stream_state * st, stream_cursor_read * pr, decoder[p[i]] == ctype_space) ) { ss->binary = 1; - if (ss->pfb_state != 0) { - /* Stop at the end of the .PFB binary data. */ - ss->record_left = ss->pfb_state->record_left; - } break; } } if (ss->binary) { - if (count > ss->record_left) { - count = ss->record_left; - status = 0; - } - /* - * We pause at the end of the .PFB binary data, - * in an attempt to keep from reading beyond the end of - * the encrypted data. + /* + * There is no need to pause at the end of the binary portion. + * The padding bytes (which are in the text portion, in hexadecimal) + * do their job, provided the write buffer is <= 256 bytes long. + * This is (hopefully) ensured by the comment just above the + * definition of s_exD_template. */ - if ((ss->record_left -= count) == 0) - ss->record_left = max_long; pr->ptr = p + count; } else { /* |