summaryrefslogtreecommitdiff
path: root/sc
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:35:03 -0500
commitf993674c110a0357efde3cbe350128c183551211 (patch)
tree234fa872d7329adbfa9cde1d071c736942af8eb0 /sc
parent0bccd9c15c550ae5af588fd29b948de815af376f (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')
-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 ];