From 20a40e197cdabf423a19ce786bc8bf16efedbba5 Mon Sep 17 00:00:00 2001 From: Andrei Drexler Date: Sun, 19 Nov 2023 10:14:41 +0100 Subject: [PATCH] Replace potentially unsafe sprintf with q_snprintf --- Quake/keys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Quake/keys.c b/Quake/keys.c index 2699627d0..6fe67e263 100644 --- a/Quake/keys.c +++ b/Quake/keys.c @@ -1138,7 +1138,7 @@ void Key_Event (int key, qboolean down) kb = keybindings[key]; if (kb && kb[0] == '+') { - sprintf (cmd, "-%s %i\n", kb+1, key); + q_snprintf (cmd, sizeof (cmd), "-%s %i\n", kb+1, key); Cbuf_AddText (cmd); } if (key_dest == key_console && key == K_MOUSE1) @@ -1163,7 +1163,7 @@ void Key_Event (int key, qboolean down) { if (kb[0] == '+') { // button commands add keynum as a parm - sprintf (cmd, "%s %i\n", kb, key); + q_snprintf (cmd, sizeof (cmd), "%s %i\n", kb, key); Cbuf_AddText (cmd); } else