Skip to content

Commit

Permalink
Fixed crashes under (Plasma) Wayland on opening tab and splitting
Browse files Browse the repository at this point in the history
With this check, I can't make QTerminal crash by splitting or opening new tabs under Plasma Wayland.

Fixes lxqt/qterminal#806 and fixes lxqt/qterminal#820
  • Loading branch information
tsujan authored and Chih-Hsuan Yen committed May 2, 2021
1 parent f1abcbd commit cd790ed
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/TerminalCharacterDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ void PlainTextDecoder::decodeLine(const Character* const characters, int count,
_linePositions << pos;
}

// check the real length
for (int i = 0 ; i < count ; i++)
{
if (characters + i == nullptr)
{
count = i;
break;
}
}

//TODO should we ignore or respect the LINE_WRAPPED line property?

//note: we build up a QString and send it to the text stream rather writing into the text
Expand Down

0 comments on commit cd790ed

Please sign in to comment.