[Libreoffice-commits] core.git: basic/source

Stephan Bergmann sbergman at redhat.com
Mon Aug 22 14:21:49 UTC 2016


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

New commits:
commit c0ee13464f239d84bb4afaf34e491413eb49961b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 22 16:20:56 2016 +0200

    Avoid OUString::operator[] out-of-bounds assertion when line ends with "&"
    
    Change-Id: I430e1df81a378243b139c654869589f1a75f5897

diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 968458f..bb263a8 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -421,7 +421,7 @@ bool SbiScanner::NextSym()
     }
 
     // Hex/octal number? Read in and convert:
-    else if(nCol < aLine.getLength() && aLine[nCol] == '&')
+    else if(aLine.getLength() - nCol > 1 && aLine[nCol] == '&')
     {
         ++pLine; ++nCol;
         sal_Unicode base = 16;


More information about the Libreoffice-commits mailing list