Avoid a potentially invalid LargeConsoleRead line.
I think it might be possible for m_dirtyLineCount to be greater than the windowRect.top() + windowRect.height(). If it is, then scanForDirtyLines will perform an invalid read while trying to initialize prevLineAttr.
This commit is contained in:
parent
24dd41bb79
commit
70eafd08d3
@ -708,7 +708,8 @@ void Agent::scrollingScrapeOutput(const ConsoleScreenBufferInfo &info)
|
||||
// necessary so long as the cursor is inside the current window.)
|
||||
const int firstReadLine = std::min(firstVirtLine - m_scrolledCount,
|
||||
m_dirtyLineCount - 1);
|
||||
const int stopReadLine = windowRect.top() + windowRect.height();
|
||||
const int stopReadLine = std::max(windowRect.top() + windowRect.height(),
|
||||
m_dirtyLineCount);
|
||||
ASSERT(firstReadLine >= 0 && stopReadLine > firstReadLine);
|
||||
largeConsoleRead(m_readBuffer,
|
||||
*m_console,
|
||||
|
Loading…
Reference in New Issue
Block a user