summaryrefslogtreecommitdiff
path: root/sc/source/filter/excel/frmbase.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-11-08 16:27:37 -0500
committerKohei Yoshida <kyoshida@novell.com>2010-11-08 16:27:37 -0500
commitf94db13767b15da68257b220cdafa45b3f888248 (patch)
tree902e8b809b5e3b3f3a3bd73dd9409bc8b9e5c588 /sc/source/filter/excel/frmbase.cxx
parent7fea18e09a285f05fb2282904662ff9a62aa2821 (diff)
Fixed a crash on importing named ranges on higher sheets.
When importing xls document containing named ranges on sheets higher than 256 (max number of sheets Calc supports currently), Calc would crash. We need to check for the upper boundary condition before accessing the array by index to prevent crash. (n#649941)
Diffstat (limited to 'sc/source/filter/excel/frmbase.cxx')
-rw-r--r--sc/source/filter/excel/frmbase.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/filter/excel/frmbase.cxx b/sc/source/filter/excel/frmbase.cxx
index 721ebb72f1b4..89d7c7423b68 100644
--- a/sc/source/filter/excel/frmbase.cxx
+++ b/sc/source/filter/excel/frmbase.cxx
@@ -104,7 +104,7 @@ void _ScRangeListTabs::Append( ScSingleRefData a, SCsTAB nTab, const BOOL b )
if( nTab < 0)
nTab = a.nTab;
- if( nTab >= 0 )
+ if( nTab >= 0 && nTab <= MAXTAB)
{
_ScRangeList* p = ppTabLists[ nTab ];
@@ -169,7 +169,7 @@ void _ScRangeListTabs::Append( ScComplexRefData a, SCsTAB nTab, const BOOL b )
if( nTab < -1)
nTab = a.Ref1.nTab;
- if( nTab >= 0 )
+ if( nTab >= 0 && nTab <= MAXTAB)
{
_ScRangeList* p = ppTabLists[ nTab ];