mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 14:16:18 +00:00
Fix infinite loop due to underflow when redrawing scrollbar, from Pavel
Lavrukhin in GitHub issue 4932.
This commit is contained in:
@@ -1108,11 +1108,17 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
|
||||
if (sb_x >= sx || sb_y >= sy)
|
||||
return;
|
||||
imax = sb_w + sb_pad;
|
||||
if ((int)imax + sb_x > sx)
|
||||
if ((int)imax + sb_x > sx) {
|
||||
if (sb_x >= sx)
|
||||
return;
|
||||
imax = sx - sb_x;
|
||||
}
|
||||
jmax = sb_h;
|
||||
if ((int)jmax + sb_y > sy)
|
||||
if ((int)jmax + sb_y > sy) {
|
||||
if (sb_y >= sy)
|
||||
return;
|
||||
jmax = sy - sb_y;
|
||||
}
|
||||
|
||||
for (j = 0; j < jmax; j++) {
|
||||
py = sb_y + j;
|
||||
|
||||
Reference in New Issue
Block a user