From ce8ea2db66db0f81312df8fc993aa47d200a1305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 21 Nov 2021 15:05:38 +0100 Subject: [PATCH] input: legacy: reduce size of reply buffer Its maximum size is known; the only two variables are two integers. We know the maximum length of an integer converted to a string. --- input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input.c b/input.c index 773c6c0c..9d4efe34 100644 --- a/input.c +++ b/input.c @@ -1083,7 +1083,7 @@ legacy_kbd_protocol(struct seat *seat, struct terminal *term, int modify_param = mod_param_map[keymap_mods]; xassert(modify_param != 0); - char reply[1024]; + char reply[32]; size_t n = xsnprintf(reply, sizeof(reply), "\x1b[27;%d;%d~", modify_param, sym); term_to_slave(term, reply, n); }