xmlsecurity/source/helper/pdfsignaturehelper.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 1c9f55e7a1d3321bcc817d6302c6fdb70c310c55
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: Fri Oct 29 16:13:38 2021 +0200

    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 <jenkinscollaboraoff...@gmail.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 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)
             {

Reply via email to