[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tortoisesvn-dev
Subject:    Re: [tortoisesvn] r22202 committed - Prevent a crash by checking
From:       Stefan_Küng <tortoisesvn () gmail ! com>
Date:       2011-10-28 18:36:25
Message-ID: 4EAAF629.8090409 () gmail ! com
[Download RAW message or body]

On 27.10.2011 22:50, Oto BREZINA wrote:
> On 2011-10-27 20:24, tortoisesvn@googlecode.com wrote:
>> Revision: 22202
>> Author:   tortoisesvn
>> Date:     Thu Oct 27 11:23:36 2011
>> Log:      Prevent a crash by checking the index validity.
>> http://code.google.com/p/tortoisesvn/source/detail?r=22202
>>
>> Modified:
>>     /trunk/src/TortoiseMerge/BaseView.cpp
>>
>> =======================================
>> --- /trunk/src/TortoiseMerge/BaseView.cpp	Sat Oct  8 00:46:14 2011
>> +++ /trunk/src/TortoiseMerge/BaseView.cpp	Thu Oct 27 11:23:36 2011
>> @@ -3288,10 +3288,13 @@
>>         if (nSubLine>=0)
>>         {
>>             int nViewLine = GetViewLineForScreen(nLineIndex);
>> -        int nMultilineCount = CountMultiLines(nViewLine);
>> -        if ((nMultilineCount>0)&&   (nSubLine<nMultilineCount-1))
>> -        {
>> -            nLength--;
>> +        if (nViewLine>   (int)m_ScreenedViewLine.size())
> Are you sure this test is correct ? I guess nViewLine shoud NOT be more
> than (int)m_ScreenedViewLine.size() as it will means access over array
> index instead of prevent it. If this fixed sme bug, that bug is
> somewhere else.

Thanks for noticing!
Should of course be < not >.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2866217

To unsubscribe from this discussion, e-mail: [dev-unsubscribe@tortoisesvn.tigris.org].
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic