summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-10-27 17:34:35 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-10-27 20:21:02 +0200
commit4beac67a2ba1e63e2b47ab54a34cb3e9af77b593 (patch)
tree46755fbf76adf2590fe2dfcae90260bbc3abde66 /xmlsecurity
parent4433d95b374c13a3501cdf3a6e273f68eb49873a (diff)
xmlsecurity PDF verify: handle missing trailer
Support for Cross-Reference Streams is still missing, but this avoids a crash at least. Change-Id: I8c5d16531f8603feeebe8feddb7c3bdfa61943cb
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/pdfio/pdfdocument.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx b/xmlsecurity/source/pdfio/pdfdocument.cxx
index a0e00ef8f3f5..1ca73618cff5 100644
--- a/xmlsecurity/source/pdfio/pdfdocument.cxx
+++ b/xmlsecurity/source/pdfio/pdfdocument.cxx
@@ -909,6 +909,13 @@ bool PDFDocument::Read(SvStream& rStream)
SAL_WARN("xmlsecurity.pdfio", "PDFDocument::Read: failed to tokenizer trailer after xref");
return false;
}
+
+ if (!m_pTrailer)
+ {
+ SAL_WARN("xmlsecurity.pdfio", "PDFDocument::Read: found no trailer");
+ return false;
+ }
+
auto pPrev = dynamic_cast<PDFNumberElement*>(m_pTrailer->Lookup("Prev"));
if (pPrev)
nStartXRef = pPrev->GetValue();