xmlsecurity/source/helper/pdfsignaturehelper.cxx | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit 97b15bcc2d15dd754afbfbf8709fa62a9866160e Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Oct 25 12:04:30 2021 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Mon Oct 25 14:04:56 2021 +0200 tdf#145312 xmlsecurity: prevent from crash when cannot receive pdfium annotation Change-Id: I6adc2cb0a07eb08a50c610958983493f4f8031ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124021 Tested-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/xmlsecurity/source/helper/pdfsignaturehelper.cxx b/xmlsecurity/source/helper/pdfsignaturehelper.cxx index 31740779de1c..95fca26f5945 100644 --- a/xmlsecurity/source/helper/pdfsignaturehelper.cxx +++ b/xmlsecurity/source/helper/pdfsignaturehelper.cxx @@ -275,6 +275,11 @@ void AnalyizeSignatureStream(SvMemoryStream& rStream, std::vector<PageChecksum>& for (int i = 0; i < pPdfPage->getAnnotationCount(); ++i) { std::unique_ptr<vcl::pdf::PDFiumAnnotation> pPdfAnnotation = pPdfPage->getAnnotation(i); + if (!pPdfAnnotation) + { + SAL_WARN("xmlsecurity.helper", "Cannot get PDFiumAnnotation"); + continue; + } vcl::pdf::PDFAnnotationSubType eType = pPdfAnnotation->getSubType(); switch (eType) {