[hackers] [scroll] Catch invalid cursor positions || Jochen Sprickerhof

From: <git_AT_suckless.org>
Date: Sat, 18 Apr 2020 23:04:14 +0200 (CEST)

commit a4faed60e37174f43dce47e099a8b55b1f1a5556
Author: Jochen Sprickerhof <git_AT_jochen.sprickerhof.de>
AuthorDate: Fri Apr 17 23:33:34 2020 +0200
Commit: Jochen Sprickerhof <git_AT_jochen.sprickerhof.de>
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
_AT_@ -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
Received on Sat Apr 18 2020 - 23:04:14 CEST

This archive was generated by hypermail 2.3.0 : Sat Apr 18 2020 - 23:12:35 CEST