summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/docshell/impex.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 0a68d360fade..cd92f13e0586 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1753,15 +1753,35 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
{
case 'X':
nCol = static_cast<SCCOL>(OUString(p).toInt32()) + nStartCol - 1;
+ if (nCol < 0 || MAXCOL < nCol)
+ {
+ SAL_WARN("sc.ui","ScImportExport::Sylk2Doc - ;X invalid nCol=" << nCol);
+ nCol = std::max<SCCOL>( 0, std::min<SCCOL>( nCol, MAXCOL));
+ }
break;
case 'Y':
nRow = OUString(p).toInt32() + nStartRow - 1;
+ if (nRow < 0 || MAXROW < nRow)
+ {
+ SAL_WARN("sc.ui","ScImportExport::Sylk2Doc - ;Y invalid nRow=" << nRow);
+ nRow = std::max<SCROW>( 0, std::min<SCROW>( nRow, MAXROW));
+ }
break;
case 'C':
nRefCol = static_cast<SCCOL>(OUString(p).toInt32()) + nStartCol - 1;
+ if (nRefCol < 0 || MAXCOL < nRefCol)
+ {
+ SAL_WARN("sc.ui","ScImportExport::Sylk2Doc - ;C invalid nRefCol=" << nRefCol);
+ nRefCol = std::max<SCCOL>( 0, std::min<SCCOL>( nRefCol, MAXCOL));
+ }
break;
case 'R':
nRefRow = OUString(p).toInt32() + nStartRow - 1;
+ if (nRefRow < 0 || MAXROW < nRefRow)
+ {
+ SAL_WARN("sc.ui","ScImportExport::Sylk2Doc - ;R invalid nRefRow=" << nRefRow);
+ nRefRow = std::max<SCROW>( 0, std::min<SCROW>( nRefRow, MAXROW));
+ }
break;
case 'K':
{