Kaydet (Commit) 227d9d3f authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#3412 SYLK import: check ;X;Y;C;R col/row validity early

Change-Id: I91fcd2571e528201e01467f3bcdbbff30cdfb50c
Reviewed-on: https://gerrit.libreoffice.org/42423Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 9887c7ff
......@@ -1893,9 +1893,19 @@ 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 'P' :
if ( bData )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment