Catch invalid cursor positions - scroll - scrollbackbuffer program for st
(HTM) git clone git://git.suckless.org/scroll
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit a4faed60e37174f43dce47e099a8b55b1f1a5556
(DIR) parent 129f09a92636f53610b2dd5d1e02ced0ff765615
(HTM) Author: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Fri, 17 Apr 2020 23:33:34 +0200
Catch invalid cursor positions
Diffstat:
M scroll.c | 3 +++
1 file changed, 3 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/scroll.c b/scroll.c
@@ -232,6 +232,9 @@ getcursorposition(int *x, int *y)
if (sscanf(input, "\033[%d;%dR", x, y) != 2)
die("parsing cursor position");
+
+ if (x <= 0 || y <= 0)
+ die("invalid cursor position");
}
void