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

Takeshi Abe tabe at fixedpoint.jp
Tue Nov 10 04:27:54 PST 2015


 vcl/source/outdev/text.cxx |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit e3bd0951e6b8e8889aabc8640c5641ab32300517
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Fri Oct 16 10:36:23 2015 +0900

    vcl: Assert that a non-negative nXPos is always found
    
    Change-Id: Ifb85cac1289af94102947b9064a8c12ca65ad43b
    Reviewed-on: https://gerrit.libreoffice.org/19404
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 9a745be..c37951e 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1124,6 +1124,7 @@ bool OutputDevice::GetCaretPositions( const OUString& rStr, long* pCaretXArray,
     for( i = 0; i < 2 * nLen; ++i )
         if( pCaretXArray[ i ] >= 0 )
             break;
+    assert(i < 2 * nLen); // otherwise i may go beyond the end of pCaretXArray
     long nXPos = pCaretXArray[ i ];
     for( i = 0; i < 2 * nLen; ++i )
     {


More information about the Libreoffice-commits mailing list