summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-06-26 12:15:19 +0100
committerAndras Timar <andras.timar@collabora.com>2018-08-08 14:06:34 +0200
commitba9bd5c9a83b7a1e02e17af63f0a33703b2005d9 (patch)
treeb908dae0054ba602acc2d81276788b62db6d9bb2 /sw
parent405258075fbadfb7e07288b324b86541a3e59eb8 (diff)
forcepoint#48 null deref
Reviewed-on: https://gerrit.libreoffice.org/56463 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit 6725491ce8ef2e41feb9b732ad7ac366ba545ca9) Change-Id: I790fc6dafc0d8c9783b9dddc266b313af2a046d7 (cherry picked from commit 5ef3fadd509766032cd402552153e9d5e743a22d)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unoportenum.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index ff156d2fbd34..41766ab4b839 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -288,25 +288,25 @@ namespace
::sw::mark::AnnotationMark* const pAnnotationMark =
dynamic_cast< ::sw::mark::AnnotationMark* >(ppMark->get());
- if ( pAnnotationMark == nullptr )
- {
+ if (!pAnnotationMark)
continue;
- }
const SwPosition& rStartPos = pAnnotationMark->GetMarkStart();
- if ( rStartPos.nNode == nOwnNode )
+ if (rStartPos.nNode != nOwnNode)
+ continue;
+
+ const SwFormatField* pAnnotationFormatField = pAnnotationMark->GetAnnotationFormatField();
+ if (!pAnnotationFormatField)
{
- const SwFormatField* pAnnotationFormatField = pAnnotationMark->GetAnnotationFormatField();
- OSL_ENSURE( pAnnotationFormatField != nullptr, "<lcl_FillAnnotationStartArray(..)> - annotation fmt fld instance missing!" );
- if ( pAnnotationFormatField != nullptr )
- {
- rAnnotationStartArr.insert(
- std::make_shared<SwAnnotationStartPortion_Impl>(
- SwXTextField::CreateXTextField(&rDoc,
- pAnnotationFormatField),
- rStartPos));
- }
+ SAL_WARN("sw.core", "missing annotation format field");
+ continue;
}
+
+ rAnnotationStartArr.insert(
+ std::make_shared<SwAnnotationStartPortion_Impl>(
+ SwXTextField::CreateXTextField(&rDoc,
+ pAnnotationFormatField),
+ rStartPos));
}
}
}