summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarina Machalkova <kmachalkova@suse.cz>2011-05-19 16:21:52 +0200
committerKatarina Machalkova <kmachalkova@suse.cz>2011-05-19 17:51:13 +0200
commitb1ad6ec86661730b5dcd787bc7a0b5337a3c6eb7 (patch)
treeffdd4dcc292c41c141dc0f5183856fe94a4e7f2d
parent70af08e849a93d56915b7abe14537facf1022a6a (diff)
Fix for fdo#37322 (binary import crash)
Avoid retrieving defined name items on positions >= maNameList.size() (boost::ptr_vector doesn't like it) Signed-off-by: Kohei Yoshida <kyoshida@novell.com> Signed-off-by: Michael Meeks <michael.meeks@novell.com> Signed-off-by: Noel Power <noel.power@novell.com>
-rw-r--r--sc/source/filter/excel/xiname.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx
index 15bf618d8..90be4dc02 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -271,7 +271,7 @@ const XclImpName* XclImpNameManager::FindName( const String& rXclName, SCTAB nSc
const XclImpName* XclImpNameManager::GetName( sal_uInt16 nXclNameIdx ) const
{
DBG_ASSERT( nXclNameIdx > 0, "XclImpNameManager::GetName - index must be >0" );
- return &(maNameList.at( nXclNameIdx - 1 ));
+ return ( nXclNameIdx >= maNameList.size() ) ? NULL : &(maNameList.at( nXclNameIdx - 1 ));
}
// ============================================================================