termiointernals: fix possible NULL-dereference. CID1399748
This commit is contained in:
parent
485d7a3edf
commit
9785beaef0
|
@ -427,9 +427,9 @@ _sel_line(Termio *sd, int cy)
|
|||
}
|
||||
/* Right trim */
|
||||
x = sd->pty->selection.end.x;
|
||||
while (x > 0 && ((cells[x].codepoint == 0) ||
|
||||
(cells[x].codepoint == ' ') ||
|
||||
(cells[x].att.newline)))
|
||||
while ((x > 0) && (cells != NULL) && ((cells[x].codepoint == 0) ||
|
||||
(cells[x].codepoint == ' ') ||
|
||||
(cells[x].att.newline)))
|
||||
{
|
||||
x--;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue