[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - basic/source

Caolán McNamara caolanm at redhat.com
Tue May 29 08:09:36 UTC 2018


 basic/source/comp/scanner.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f2d5ba04a7660ecea326d90d08ec8002462883a5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon May 28 21:51:01 2018 +0100

    forcepoint#42 check available str length
    
    Change-Id: Ie476968ddaa4c3e5475ae9aa6133e7aba38d5975
    Reviewed-on: https://gerrit.libreoffice.org/54977
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index f29b5c2a5d9f..e79f145c29b9 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -606,7 +606,7 @@ bool SbiScanner::NextSym()
             case '>': if( *pLine == '=' ) n = 2; break;
             case ':': if( *pLine == '=' ) n = 2; break;
         }
-        aSym = aLine.copy( nCol, n );
+        aSym = aLine.copy(nCol, std::min(n, aLine.getLength() - nCol));
         pLine += n-1; nCol = nCol + n;
     }
 


More information about the Libreoffice-commits mailing list