diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-10-25 12:04:30 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-10-29 16:13:38 +0200 |
commit | 1c9f55e7a1d3321bcc817d6302c6fdb70c310c55 (patch) | |
tree | 26752697c8b8d640341e4e32ab5b4f8ef353ae79 | |
parent | e62b40b056120bb5eebf00fc88f58fe042356520 (diff) |
tdf#145312 xmlsecurity: prevent from crash when cannot receive pdfium annotation
Change-Id: I6adc2cb0a07eb08a50c610958983493f4f8031ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124145
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r-- | xmlsecurity/source/helper/pdfsignaturehelper.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xmlsecurity/source/helper/pdfsignaturehelper.cxx b/xmlsecurity/source/helper/pdfsignaturehelper.cxx index ffadecfaea14..e55618befeb2 100644 --- a/xmlsecurity/source/helper/pdfsignaturehelper.cxx +++ b/xmlsecurity/source/helper/pdfsignaturehelper.cxx @@ -284,6 +284,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) { |