PDFsharp icon indicating copy to clipboard operation
PDFsharp copied to clipboard

Ensure all trailers security handlers are initialized at parsing time

Open Greybird opened this issue 1 year ago • 0 comments

Currently, the Encrypt key is only read for the document trailer. However, when mutliple trailers are present, the code for reading all indirect objects in ReadAllIndirectObjects can lead to calling IsSecurityHandler method, that can iterate over SecurityHandlers for all previous trailers. The lazy initialization code will access the Encrypt key under the asumption that it has been read already, leading to an exception.

Unfortunately, I cannot share the file leading to this discovery, sorry for this.

Greybird avatar Aug 28 '24 08:08 Greybird