commit a4faed60e37174f43dce47e099a8b55b1f1a5556
Author: Jochen Sprickerhof <[email protected]>
AuthorDate: Fri Apr 17 23:33:34 2020 +0200
Commit: Jochen Sprickerhof <[email protected]>
CommitDate: Fri Apr 17 23:33:34 2020 +0200
Catch invalid cursor positions
diff --git a/scroll.c b/scroll.c
index 25bd3fc..09a2c3e 100644
--- 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