From 956f1eaa13a78617be6271b7b71b8f47f87c906c Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Wed, 7 Jun 2017 20:40:17 +0200 Subject: [PATCH] termptyesc: restrict right/bottom rectangle coordinates --- src/bin/termptyesc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c index 284dd094..26211f95 100644 --- a/src/bin/termptyesc.c +++ b/src/bin/termptyesc.c @@ -857,6 +857,8 @@ _clean_up_rect_coordinates(Termpty *ty, if (ty->termstate.right_margin && right >= ty->termstate.right_margin) right = ty->termstate.right_margin; } + if (right > ty->w) + right = ty->w; if (bottom < 1) bottom = ty->h; @@ -867,6 +869,8 @@ _clean_up_rect_coordinates(Termpty *ty, bottom = ty->termstate.bottom_margin - 1; } bottom--; + if (bottom > ty->h) + bottom = ty->h; if ((bottom < top) || (right < left)) return -1;