sc/source/ui/docshell/impex.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f34a205e60846c91bcd22116c9e6e667ebb1e515
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Apr 12 12:26:54 2022 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Apr 13 10:29:52 2022 +0200

    ofz#46352 assert on bad string offset
    
    Change-Id: I60123fd0460b8038f08582a0bcbf2307af321df1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132862
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 260db563e203..a2360eb494c9 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2206,7 +2206,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
                     aFormats.push_back( nKey );
                 }
             }
-            else if( cTag == 'I' && *p == 'D' )
+            else if (cTag == 'I' && *p == 'D' && aLine.getLength() > 4)
             {
                 aLine = aLine.copy(4);
                 if (aLine == "CALCOOO32")

Reply via email to