[Libreoffice-commits] core.git: 2 commits - starmath/source sw/source

Caolán McNamara caolanm at redhat.com
Sun Dec 31 13:59:47 UTC 2017


 starmath/source/mathmlimport.cxx   |    6 +++++-
 sw/source/filter/html/htmlsect.cxx |    2 +-
 sw/source/filter/html/htmltab.cxx  |    2 +-
 sw/source/filter/html/swhtml.hxx   |    2 +-
 4 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 37f4239e511cb6b4cc6f1c2e76617acd13c8980a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Dec 31 13:58:06 2017 +0000

    ofz#4845 avoid oom
    
    Change-Id: I816e2a2e2c21bf999c261e59c860fd142ba59f76

diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 0caa425e8cba..336c926bd62a 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -2675,6 +2675,10 @@ void SmXMLTableContext_Impl::EndElement()
         nCols = std::max(nCols, pArray->GetNumSubNodes());
         aReverseStack.push_front(std::unique_ptr<SmNode>(pArray));
     }
+    if (nCols > SAL_MAX_UINT16)
+        throw std::range_error("column limit");
+    if (nRows > SAL_MAX_UINT16)
+        throw std::range_error("row limit");
     aExpressionArray.resize(nCols*nRows);
     size_t j=0;
     while ( !aReverseStack.empty() )
@@ -2691,7 +2695,7 @@ void SmXMLTableContext_Impl::EndElement()
     aToken.eType = TMATRIX;
     std::unique_ptr<SmMatrixNode> pSNode(new SmMatrixNode(aToken));
     pSNode->SetSubNodes(aExpressionArray);
-    pSNode->SetRowCol(static_cast<sal_uInt16>(nRows),nCols);
+    pSNode->SetRowCol(nRows, nCols);
     rNodeStack.push_front(std::move(pSNode));
 }
 
commit 2ed6eba4f99681fe717741ddc1534ed3ccc15e82
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Dec 30 22:02:55 2017 +0000

    CurrentTableInPaM->PendingTableInPaM
    
    Change-Id: Ic8b48d3b3e3f87e9ac3e8a6bb832f8e8dfe8ab7d

diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx
index 7b256856e4ba..e5c2cf1268f8 100644
--- a/sw/source/filter/html/htmlsect.cxx
+++ b/sw/source/filter/html/htmlsect.cxx
@@ -195,7 +195,7 @@ void SwHTMLParser::NewDivision( HtmlTokenId nToken )
                 static_cast<const SwStartNode *>( &rContentStIdx.GetNode() );
             aDelPam.GetPoint()->nNode = pStNd->EndOfSectionIndex() - 1;
 
-            if (!CurrentTableInPaM(aDelPam))
+            if (!PendingTableInPaM(aDelPam))
                 m_xDoc->getIDocumentContentOperations().DelFullPara(aDelPam);
 
             // update page style
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 50bcffa1554a..7c6fb3933d16 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -5258,7 +5258,7 @@ std::shared_ptr<HTMLTable> SwHTMLParser::BuildTable(SvxAdjust eParentAdjust,
     return xRetTable;
 }
 
-bool SwHTMLParser::CurrentTableInPaM(SwPaM& rPam) const
+bool SwHTMLParser::PendingTableInPaM(SwPaM& rPam) const
 {
     bool bRet = false;
     for (const auto& a : m_aTables)
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 0048278e0756..24996cf2d340 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -870,7 +870,7 @@ private:
     bool HasCurrentParaFlys( bool bNoSurroundOnly = false,
                              bool bSurroundOnly = false ) const;
 
-    bool CurrentTableInPaM(SwPaM& rPam) const;
+    bool PendingTableInPaM(SwPaM& rPam) const;
 
 public:         // used in tables
 


More information about the Libreoffice-commits mailing list