summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-12-31 14:19:34 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-12-31 14:19:34 +0000
commitd4d0b1a2b9f11fb7629559e08c345697ba129c04 (patch)
tree9da3c3ba5c0c85e4d9e39ab936280950ec093109
parent45e5b5da183e57c80287bf182433f529a0e64bd7 (diff)
ofz#4848 Null-dereference READ
Change-Id: I632aca7e3f59b7edf48c8c35eff4abf1946af652
-rw-r--r--sw/source/filter/html/swhtml.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 7376ab23da47..d6ffd1928348 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -1462,10 +1462,10 @@ void SwHTMLParser::NextToken( HtmlTokenId nToken )
if( !aToken.isEmpty() && ' '==aToken[0] && !IsReadPRE() )
{
sal_Int32 nPos = m_pPam->GetPoint()->nContent.GetIndex();
- if( nPos )
+ const SwTextNode* pTextNode = nPos ? m_pPam->GetPoint()->nNode.GetNode().GetTextNode() : nullptr;
+ if (pTextNode)
{
- const OUString& rText =
- m_pPam->GetPoint()->nNode.GetNode().GetTextNode()->GetText();
+ const OUString& rText = pTextNode->GetText();
sal_Unicode cLast = rText[--nPos];
if( ' ' == cLast || '\x0a' == cLast)
aToken = aToken.copy(1);