From b17d5bfa1078b67d6a1bb881c5130b4c3aa1ae33 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 22 Nov 2020 20:13:13 +0000 Subject: ofz#27756 null deref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iccbd368a69f86abe7c7c72df8158db98eaf2bc58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106238 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- lotuswordpro/source/filter/lwpcelllayout.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx b/lotuswordpro/source/filter/lwpcelllayout.cxx index cd8d49d7519b..71d0bce8a943 100644 --- a/lotuswordpro/source/filter/lwpcelllayout.cxx +++ b/lotuswordpro/source/filter/lwpcelllayout.cxx @@ -66,6 +66,8 @@ #include #include +#include + #include #include #include @@ -345,7 +347,11 @@ LwpPara* LwpCellLayout::GetLastParaOfPreviousStory() if (pPreStoryID && !(pPreStoryID->IsNull())) { LwpStory* pPreStory = dynamic_cast(pPreStoryID->obj(VO_STORY).get()); - assert(pPreStory); + if (!pPreStory) + { + SAL_WARN("lwp", "unexpected null VO_STORY"); + return nullptr; + } return dynamic_cast(pPreStory->GetLastPara().obj(VO_PARA).get()); } else -- cgit