mirror of
https://github.com/tmux/tmux.git
synced 2026-03-26 13:16:37 +00:00
Protect against overflow when scrollbar is off screen, from san65384 at
gmail dot com in GitHub issue 4933.
This commit is contained in:
@@ -1091,12 +1091,13 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
|
|||||||
sy += ctx->statuslines;
|
sy += ctx->statuslines;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set up style for slider. */
|
|
||||||
gc = sb_style->gc;
|
gc = sb_style->gc;
|
||||||
memcpy(&slgc, &gc, sizeof slgc);
|
memcpy(&slgc, &gc, sizeof slgc);
|
||||||
slgc.fg = gc.bg;
|
slgc.fg = gc.bg;
|
||||||
slgc.bg = gc.fg;
|
slgc.bg = gc.fg;
|
||||||
|
|
||||||
|
if (sb_x >= sx || sb_y >= sy)
|
||||||
|
return;
|
||||||
imax = sb_w + sb_pad;
|
imax = sb_w + sb_pad;
|
||||||
if ((int)imax + sb_x > sx)
|
if ((int)imax + sb_x > sx)
|
||||||
imax = sx - sb_x;
|
imax = sx - sb_x;
|
||||||
|
|||||||
Reference in New Issue
Block a user