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

Caolán McNamara caolanm at redhat.com
Thu Dec 10 06:36:47 PST 2015


 lotuswordpro/source/filter/lwptablelayout.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 8410527550ef6db8348e8590eb0c52bccbe40310
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 10 14:33:36 2015 +0000

    check is within legal bounds
    
    Change-Id: Ie3f9e52575436b9505a412b20c7e1b24fa61f6cb

diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index 071c971..c709b63 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -578,7 +578,10 @@ void LwpTableLayout::RegisterColumns()
     LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get());
     while (pColumnLayout)
     {
-        m_pColumns[pColumnLayout->GetColumnID()] = pColumnLayout;
+        auto nColId = pColumnLayout->GetColumnID();
+        if (nColId >= nCols)
+            throw std::range_error("corrupt LwpTableLayout");
+        m_pColumns[nColId] = pColumnLayout;
         if (!pColumnLayout->IsJustifiable())
         {
             pWidthCalculated[pColumnLayout->GetColumnID()] = sal_True;


More information about the Libreoffice-commits mailing list