summaryrefslogtreecommitdiff
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 11:29:43 +0200
commit5ef3fadd509766032cd402552153e9d5e743a22d (patch)
tree72ed70d17e8800a7f0ca5a31cb44cc44510c8ebd
parentc102d535021abd31d6dfaca4f58b2312b7ef4d08 (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
-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));
}
}
}