<table><tr><td style="">mglb created this revision.<br />mglb added a reviewer: Konsole.<br />mglb added a project: Konsole.<br />mglb requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D12551">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Fixed cases mainly come from the fact that ScreenWindow can be<br />
larger that TerminalDisplay's image, and the way how selection area is<br />
bounded (character's left edge, not first/last character in selection).</p></div></div><br /><div><strong>TEST PLAN</strong><div><ul class="remarkup-list">
<li class="remarkup-list-item">Compile with ASAN</li>
<li class="remarkup-list-item">Turn on blinking cursor</li>
<li class="remarkup-list-item">Slowly change window size to less than 1 line or less than 1 column</li>
<li class="remarkup-list-item">If everything is still ok, run <tt style="background: #ebebeb; font-size: 13px;">top</tt> or anything that generates longer output</li>
</ul>

<p>Expected result: no overflows</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Random selections (normal/block/line/word):<ul class="remarkup-list">
<li class="remarkup-list-item">on screen in left/right direction</li>
<li class="remarkup-list-item">on screen + in history<ul class="remarkup-list">
<li class="remarkup-list-item">selecting history up</li>
<li class="remarkup-list-item">selecting history down</li>
</ul></li>
<li class="remarkup-list-item">first/last character → last/first character in the line</li>
<li class="remarkup-list-item">first/last character → last/first character on the screen</li>
<li class="remarkup-list-item">all above with wide characters</li>
</ul></li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>R319 Konsole</div></div></div><br /><div><strong>BRANCH</strong><div><div>wip/cursor-fixes/0001-Prevent-invalid-image-array-indexing (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D12551">https://phabricator.kde.org/D12551</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/TerminalDisplay.cpp<br />
src/TerminalDisplay.h</div></div></div><br /><div><strong>To: </strong>mglb, Konsole<br /><strong>Cc: </strong>Konsole, herrold, ngraham, hindenburg<br /></div>