summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-12-09 19:37:36 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-12-11 13:46:18 +0100
commitb06ef4699e486368840bf0f7457debbe7f985ab0 (patch)
treea0ab504828a7254ec2a2fcdc634684feb224f4bf
parentc4d0cd148128ceec55b95407d637d42e27426966 (diff)
ofz: crash on null pTableNd
Change-Id: I9396afb40d75ee2463005a4501233dde1683f556 Reviewed-on: https://gerrit.libreoffice.org/46165 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/filter/html/htmltab.cxx2
-rw-r--r--sw/source/filter/html/swhtml.cxx9
2 files changed, 10 insertions, 1 deletions
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index b8518a497f17..8f7dccdeb8ee 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -2715,6 +2715,8 @@ const SwStartNode *SwHTMLParser::InsertTableSection( sal_uInt16 nPoolId )
else
{
SwTableNode *pTableNd = pNd->FindTableNode();
+ if (!pTableNd)
+ throw std::runtime_error("missing table");
if( pTableNd->GetTable().GetHTMLTableLayout() )
{ // if there is already a HTMTableLayout, this table is already finished
// and we have to look for the right table in the environment
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index bd4b8edb7878..1ddf9f741270 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -5533,7 +5533,14 @@ bool TestImportHTML(SvStream &rStream)
SwPaM aPaM( aIdx );
aPaM.GetPoint()->nContent.Assign(aIdx.GetNode().GetContentNode(), 0);
pD->SetInReading(true);
- bool bRet = xReader->Read(*pD, OUString(), aPaM, OUString()) == ERRCODE_NONE;
+ bool bRet = false;
+ try
+ {
+ bRet = xReader->Read(*pD, OUString(), aPaM, OUString()) == ERRCODE_NONE;
+ }
+ catch (const std::runtime_error&)
+ {
+ }
pD->SetInReading(false);
return bRet;