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