[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [tortoisesvn] r22202 committed - Prevent a crash by checking the index validity.

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Fri, 28 Oct 2011 20:36:25 +0200

On 27.10.2011 22:50, Oto BREZINA wrote:
> On 2011-10-27 20:24, tortoisesvn_at_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_at_tortoisesvn.tigris.org].
Received on 2011-10-28 20:36:39 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.