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

Caolán McNamara caolanm at redhat.com
Tue Apr 17 10:13:27 UTC 2018


 lotuswordpro/source/filter/lwptablelayout.cxx |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit a5cd6eb9efadc3d0ca2648acdc96e780bda8ad20
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 17 09:08:09 2018 +0100

    ofz#7729 Null-dereference READ
    
    Change-Id: I223f4f7fd622822b42d8e7cb342d451c54d6dcbd
    Reviewed-on: https://gerrit.libreoffice.org/53017
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index 379c44b34c13..ff4b7f65a6f9 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -543,8 +543,13 @@ OUString LwpTableLayout::GetColumnWidth(sal_uInt16 nCol)
  */
 void LwpTableLayout::RegisterColumns()
 {
-    LwpTable * pTable = GetTable();
-    LwpSuperTableLayout * pSuper = GetSuperTableLayout();
+    LwpTable* pTable = GetTable();
+    if (!pTable)
+        throw std::range_error("corrupt LwpTableLayout");
+
+    LwpSuperTableLayout* pSuper = GetSuperTableLayout();
+    if (!pSuper)
+        throw std::range_error("corrupt LwpTableLayout");
 
     sal_uInt16 nCols = m_nCols;
 
@@ -556,9 +561,6 @@ void LwpTableLayout::RegisterColumns()
         m_aColumns[i] = nullptr;
     }
 
-    if (!pTable)
-        throw std::range_error("corrupt LwpTableLayout");
-
     double dDefaultColumn = pTable->GetWidth();
     sal_uInt16 nJustifiableColumn = nCols;
 


More information about the Libreoffice-commits mailing list