mirror of
https://github.com/tmux/tmux.git
synced 2026-07-22 08:51:17 +00:00
Guard x as well as y to avoid overflow, GitHub issue 5409 from Park
Seongjae.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: window-visible.c,v 1.4 2026/06/29 19:03:34 nicm Exp $ */
|
||||
/* $OpenBSD: window-visible.c,v 1.5 2026/07/19 17:25:38 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -81,7 +81,7 @@ window_visible_ranges(struct window_pane *base_wp, int px, int py, u_int width,
|
||||
}
|
||||
|
||||
w = base_wp->window;
|
||||
if ((u_int)py >= w->sy)
|
||||
if ((u_int)py >= w->sy || (u_int)px >= w->sx)
|
||||
goto empty;
|
||||
if (px + width > w->sx)
|
||||
width = w->sx - px;
|
||||
|
||||
Reference in New Issue
Block a user