Skip to content

Commit

Permalink
safeguard multi-line bidi against looking back beyond scrollback buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Feb 25, 2022
1 parent 0f54c27 commit 3cb4cd2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/termline.c
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,8 @@ term_bidi_line(termline *line, int scr_y)
ushort parabidi = (ushort)-1;
bool brk = false;
do {
if (term.disptop + y < -sblines())
break; // skip attempt to look back beyond scrollback buffer
termline *prevline = fetch_line(term.disptop + y);
//printf("back @%d %04X %.22ls auto %d lvl %d\n", y, prevline->lattr, wcsline(prevline), autodir, level);
if (prevline->lattr & LATTR_WRAPPED) {
Expand Down

0 comments on commit 3cb4cd2

Please sign in to comment.