summaryrefslogtreecommitdiff
path: root/sw/source/core/table
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2015-04-22 19:46:18 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2015-04-23 20:42:59 +0200
commitc33422e2c21ed8160fbbb969698216a8a1aeb0b8 (patch)
tree5daf02b032fb3e8b26ed348f22b15f3979b48a7e /sw/source/core/table
parentb2ead407c70f71974a1eac79df09072ff8bd0cc2 (diff)
Avoid dereference a past-the-end iterator on import of fdo81650-2.docx
Change-Id: I8b503da737b3f3c35e7dee18166068323ef6f76e
Diffstat (limited to 'sw/source/core/table')
-rw-r--r--sw/source/core/table/swnewtable.cxx25
1 files changed, 14 insertions, 11 deletions
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index fb1f78b0ae61..89b07f16e7d0 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -2126,19 +2126,22 @@ void SwTable::CheckConsistency() const
{
SAL_WARN_IF( aIter == aRowSpanCells.end(),
"sw.core", "Missing master box");
- SAL_WARN_IF( aIter->nLeft != nWidth || aIter->nRight != nNewWidth,
- "sw.core", "Wrong position/size of overlapped table box");
- --(aIter->nRowSpan);
- SAL_WARN_IF( aIter->nRowSpan != -nRowSp, "sw.core",
- "Wrong row span value" );
- if( nRowSp == -1 )
+ if (aIter != aRowSpanCells.end())
{
- std::list< RowSpanCheck >::iterator aEraseIter = aIter;
- ++aIter;
- aRowSpanCells.erase( aEraseIter );
+ SAL_WARN_IF( aIter->nLeft != nWidth || aIter->nRight != nNewWidth,
+ "sw.core", "Wrong position/size of overlapped table box");
+ --(aIter->nRowSpan);
+ SAL_WARN_IF( aIter->nRowSpan != -nRowSp, "sw.core",
+ "Wrong row span value" );
+ if( nRowSp == -1 )
+ {
+ std::list< RowSpanCheck >::iterator aEraseIter = aIter;
+ ++aIter;
+ aRowSpanCells.erase( aEraseIter );
+ }
+ else
+ ++aIter;
}
- else
- ++aIter;
}
else if( nRowSp != 1 )
{