From 96b9a924fa75be562a2d81834b777ce91fd30326 Mon Sep 17 00:00:00 2001 From: Katarina Machalkova Date: Thu, 19 May 2011 16:21:52 +0200 Subject: [PATCH] Fix for fdo#37322 (binary import crash) Avoid retrieving defined name items on positions >= maNameList.size() (boost::ptr_vector doesn't like it) --- sc/source/filter/excel/xiname.cxx | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx index 15bf618..90be4dc 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 )); } // ============================================================================ -- 1.7.3.4