mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-17 10:50:51 +01:00
Don't read beyond the edge of the screen when searching (dies with debug
enabled).
This commit is contained in:
parent
c41aa49059
commit
55336657d4
@ -504,6 +504,8 @@ window_copy_search_rl(struct grid *gd,
|
|||||||
u_int ax, bx, px;
|
u_int ax, bx, px;
|
||||||
|
|
||||||
for (ax = last + 1; ax > first; ax--) {
|
for (ax = last + 1; ax > first; ax--) {
|
||||||
|
if (gd->sx - (ax - 1) < sgd->sx)
|
||||||
|
continue;
|
||||||
for (bx = 0; bx < sgd->sx; bx++) {
|
for (bx = 0; bx < sgd->sx; bx++) {
|
||||||
px = ax - 1 + bx;
|
px = ax - 1 + bx;
|
||||||
if (!window_copy_search_compare(gd, px, py, sgd, bx))
|
if (!window_copy_search_compare(gd, px, py, sgd, bx))
|
||||||
|
Loading…
Reference in New Issue
Block a user