writerfilter/source/dmapper/DomainMapper_Impl.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 83923eb10c198ae86e20bf9eb7def400a8c08268
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Jun 27 10:00:13 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Jun 27 15:51:45 2022 +0200

    crashtesting: fix assert seen with forum-mso-en-8349.docx
    
    a string that ends in spaces
    
    Change-Id: I808f046be816d0d4a76f801a349e284024a2061c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136465
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 773fecdda521..2aa50c5cab92 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4296,7 +4296,7 @@ static OUString lcl_ExtractVariableAndHint( const 
OUString& rCommand, OUString&
     sal_Int32 nIndex = rCommand.indexOf( ' ', 2); //find last space after 'ASK'
     if (nIndex == -1)
         return OUString();
-    while(rCommand[nIndex] == ' ')
+    while (nIndex < rCommand.getLength() && rCommand[nIndex] == ' ')
         ++nIndex;
     OUString sShortCommand( rCommand.copy( nIndex ) ); //cut off the " ASK "
 

Reply via email to