Mariusz Glebocki fcea6742c1 Move search line upper bound check to less generic function
Summary:
When there was at least one search attempt, search box is still opened,
and the screen and/or history is cleared, there is a high chance that
the line number remembered by the search is invalid. The line number is
used as the lines array index, so this can lead to overflow and crash.

This is at this moment fixed with a check in `copyLineToStream()`, which
is a generic function that happens to be used by search function and
where the line number is used. There still is an `assert` which is
triggered in debug builds.

The patch moves the check directly to a search function, where the line
number is initialized before first search.

Test Plan:
You have to do the test in debug build - there is a hack in
`copyLineToStream()` which prevents crash, but `assert` before it
catches an error condition.

* Run `seq 5000`
* Open search box, search for `000`
* Clear screen/history
* Search up/down

Actual result: Crash
Expected result: Search should begin from last/first visible line

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D14106
2018-07-14 13:11:42 -04:00
2018-07-12 09:03:26 -04:00

Konsole - KDE's Terminal Emulator
==================================

Konsole is a terminal program for KDE.

As well as being a standalone program, it is also used by other KDE programs
such as the Kate editor and KDevelop development environment to provide easy
access to a terminal window. Konsole's features and usage are explained and
illustrated in the Konsole handbook, which can be accessed by browsing to
"help:/konsole" in Konqueror.


Directory Structure
===================

 /doc/user      README files, primarily for advanced users, explaining various
                aspects of Konsole such as fonts and keyboard handling
                in-depth.

 /doc/developer README files and resources for developers of Konsole. This
                includes information on the design of Konsole's internals and
                the VT100 terminal on which Konsole's emulation is based.

 /src           Source code for Konsole, including the embedded versions of
                Konsole which are used in Kate, KDevelop and others.

 /desktop       .desktop files for Konsole, used to launch the program
                from KDE's various menus and other application launchers.

 /data          Data files for use with Konsole as well as the keyboard setup
                and color schemes provided with Konsole.


Contact
=======

Up-to-date information about the latest releases can be found on Konsole's
website at http://konsole.kde.org. Discussions about Konsole's development are
held on the konsole-devel mailing list, which can be accessed at
https://mail.kde.org/mailman/listinfo/konsole-devel.


Share and enjoy it,
  Lars
Description
No description provided
Readme 338 MiB
Languages
C++ 97.1%
C 1.2%
CMake 1.2%
Shell 0.4%
Python 0.1%