Fix for for 687135, pdf file processing error, 2nd version

Alex Cherepanov <[email protected]>
Newsgroups gmane.comp.printing.ghostscript.patches
Organization Coscript Software
Message-ID <[email protected]>
Default to empty string when there's no /ID in the trailer and issue
a warning because the key is required for encrypted files.

This is a post-commit submission.

_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review
pdf_sec.ps.diff (text/plain, 846 B)
Index: gs/lib/pdf_sec.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/pdf_sec.ps,v
retrieving revision 1.11
diff -b -u -r1.11 pdf_sec.ps
--- gs/lib/pdf_sec.ps	12 Apr 2003 18:08:18 -0000	1.11
+++ gs/lib/pdf_sec.ps	12 Nov 2003 19:50:14 -0000
@@ -100,7 +100,10 @@
   % <padded-key> <O> <P>
 
   % Step 5.
-  Trailer /ID oget 0 oget
+  Trailer /ID knownoget { 0 oget } {
+    ()
+    (   **** ID key in the trailer is required for encrypted files.\n) pdfformaterror
+  } ifelse
   3 { concatstrings } repeat md5
 
   % Step 6.
@@ -126,7 +129,10 @@
   pdf_padding_string
 
   % Step 3.
-  Trailer /ID oget 0 oget
+  Trailer /ID knownoget { 0 oget } {
+    ()
+    (   **** ID key in the trailer is required for encrypted files.\n) pdfformaterror
+  } ifelse
   concatstrings md5
 
   % Step 4.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.