[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: Oto BREZINA <otik_at_printflow.eu>
Date: Thu, 27 Oct 2011 22:50:16 +0200

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.

> + {
> + int nMultilineCount = CountMultiLines(nViewLine);
> + if ((nMultilineCount>0)&& (nSubLine<nMultilineCount-1))
> + {
> + nLength--;
> + }
> }
> }
> LPCTSTR pszLine = GetLineChars(nLineIndex);
>

-- 
Oto BREZINA
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2865480
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2011-10-27 22:50:40 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.