[Konsole-devel] fillUnusedArea - bug: 301442, 246484
Jekyll Wu
adaptee at gmail.com
Sat Jun 9 10:55:40 UTC 2012
于 2012年06月08日 21:36, Kurt Hindenburg 写道:
> This code looks wrong; remind me where this is used? The charsToFill is
> either 0 or a negative number in my testing. If the scroll back is huge,
> the charsToFill will go beyond what a -int can handle. Also, if
> charsToFill is negative don't bother calling fillWithDefaultChar.
>
> Thoughts?
> Kurt
>
>
> void ScreenWindow::fillUnusedArea()
> int screenEndLine = _screen->getHistLines() + _screen->getLines() - 1;
> int windowEndLine = currentLine() + windowLines() - 1;
>
> int unusedLines = windowEndLine - screenEndLine;
> int charsToFill = unusedLines * windowColumns();
>
> Screen::fillWithDefaultChar(_windowBuffer + _windowBufferSize -
> charsToFill, charsToFill);
>
At the moment I can only say that piece of code looks like black magic
to me, just like most other code related with history and scrollback.
The only place that function is called is within
ScreenWindow::getImage(). I still think it is necessary work to call
fillWithDefaultChar() when 'charsToFill' is negative, but that
possible overflow should be the very cause for those reported crashes.
Regards
Jekyll
More information about the konsole-devel
mailing list