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

Caolán McNamara caolanm at redhat.com
Thu Aug 13 01:01:50 PDT 2015


 sw/source/ui/vba/vbatablehelper.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f3bf85b8cacb0bf43e646f3c67f704cc89b72323
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Aug 13 09:00:25 2015 +0100

    check for negative numbers too
    
    Change-Id: I4a798a4f60d0064abd7fc4e689e4c80dff8459ff

diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx
index 65f02fd..8a96054 100644
--- a/sw/source/ui/vba/vbatablehelper.cxx
+++ b/sw/source/ui/vba/vbatablehelper.cxx
@@ -140,12 +140,12 @@ SwTableBox* SwVbaTableHelper::GetTabBox( sal_Int32 nCol, sal_Int32 nRow ) throw
 {
     SwTableLines& rLines = pTable->GetTabLines();
     sal_Int32 nRowCount = rLines.size();
-    if (nRow >= nRowCount)
+    if (nRow < 0 || nRow >= nRowCount)
         throw uno::RuntimeException();
 
     SwTableLine* pLine = rLines[ nRow ];
     sal_Int32 nColCount = pLine->GetTabBoxes().size();
-    if (nCol >= nColCount)
+    if (nCol < 0 || nCol >= nColCount)
         throw uno::RuntimeException();
 
     SwTableBox* pStart = pLine->GetTabBoxes()[ nCol ];


More information about the Libreoffice-commits mailing list