From d185608e69153547ec3981b77a3c00121f73dd5b Mon Sep 17 00:00:00 2001 From: NRK Date: Sun, 20 Aug 2023 11:18:15 +0600 Subject: [PATCH] Avoid segfault when x and y aren't given --- xdo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xdo.c b/xdo.c index 3dc8813..5482a14 100644 --- a/xdo.c +++ b/xdo.c @@ -502,6 +502,8 @@ void button_release(xcb_window_t win) void pointer_motion(xcb_window_t win) { + if (cfg.x == NULL || cfg.y == NULL) + err("pointer_motion requires x and y argument\n"); uint16_t x = atoi(cfg.x); uint16_t y = atoi(cfg.y); fake_motion(win, ISRELA(cfg.x) || ISRELA(cfg.y), x, y);