xmlsecurity/source/pdfio/pdfdocument.cxx | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit 62401ba3c9df1f7234bd272b3e659a08f546d50c Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Tue Nov 8 15:54:15 2016 +0100 xmlsecurity PDF sign: don't crash on missing trailer This will need cross-reference stream write support, just don't crash for now. Change-Id: Id48c131b22d4ed96174693f3e96b14c273d596a8 Reviewed-on: https://gerrit.libreoffice.org/30702 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx b/xmlsecurity/source/pdfio/pdfdocument.cxx index 0bc2f80..cd52f8d 100644 --- a/xmlsecurity/source/pdfio/pdfdocument.cxx +++ b/xmlsecurity/source/pdfio/pdfdocument.cxx @@ -478,6 +478,11 @@ bool PDFDocument::Sign(const uno::Reference<security::XCertificate>& xCertificat m_aEditBuffer.WriteCharPtr("\nendobj\n\n"); // Write the updated Catalog object, references nAnnotId. + if (!m_pTrailer) + { + SAL_WARN("xmlsecurity.pdfio", "PDFDocument::Sign: found no trailer"); + return false; + } auto pRoot = dynamic_cast<PDFReferenceElement*>(m_pTrailer->Lookup("Root")); if (!pRoot) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits