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

Caolán McNamara caolanm at redhat.com
Sat Dec 12 12:42:42 PST 2015


 lotuswordpro/source/filter/lwptablelayout.cxx |    2 +-
 sw/source/filter/ww8/ww8scan.cxx              |   11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 90ccda6242e9386f1825be9ded7ce66e01493565
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Dec 12 20:41:31 2015 +0000

    coverity#1341876 Untrusted loop bound
    
    Change-Id: I5191a48d3cadc8b9e4c1cc5f4ea99adb0071002f

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 144013d..842f557 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -6347,8 +6347,8 @@ void MSOPropertyBagStore::Read(SvStream& rStream)
 }
 
 MSOProperty::MSOProperty()
-    : m_nKey(0),
-    m_nValue(0)
+    : m_nKey(0)
+    , m_nValue(0)
 {
 }
 
@@ -6369,6 +6369,13 @@ void MSOPropertyBag::Read(SvStream& rStream)
     sal_uInt16 cProp(0);
     rStream.ReadUInt16(cProp);
     rStream.SeekRel(2); // cbUnknown
+    //each MSOProperty is 8 bytes in size
+    size_t nMaxPossibleRecords = rStream.remainingSize() / 8;
+    if (cProp > nMaxPossibleRecords)
+    {
+        SAL_WARN("sw.ww8", cProp << " records claimed, but max possible is " << nMaxPossibleRecords);
+        cProp = nMaxPossibleRecords;
+    }
     for (sal_uInt16 i = 0; i < cProp; ++i)
     {
         MSOProperty aProperty;
commit 18952ac1de81b522f5fef36ff922c4a0dc29499d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Dec 12 20:37:27 2015 +0000

    coverity#1341875 Division or modulo by float zero
    
    Change-Id: I3a07361bb66a62533475618c9b50f184d791a799

diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index e73bbcd..439ff50 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -611,7 +611,7 @@ void LwpTableLayout::RegisterColumns()
     }
 
     // justifiable columns will share the remain width averagely
-    dDefaultColumn = dTableWidth/nJustifiableColumn;
+    dDefaultColumn = nJustifiableColumn ? dTableWidth/nJustifiableColumn : 0;
 
     // register default column style
     XFColStyle *pColStyle = new XFColStyle();


More information about the Libreoffice-commits mailing list