From d96009fda3731b706044f1203e1b786826055d8e Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sat, 29 Nov 2025 20:40:56 +0100 Subject: Array bounds checking --- FICS/command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'FICS') diff --git a/FICS/command.c b/FICS/command.c index 2589f5a..f35b1db 100644 --- a/FICS/command.c +++ b/FICS/command.c @@ -412,7 +412,8 @@ printusage(int p, char *command_str) int command; int i, parlen, UseLang = parray[p].language; - if ((command = match_command(command_str, p)) < 0) { + if ((command = match_command(command_str, p)) < 0 || + command >= (int)ARRAY_SIZE(command_list)) { pprintf(p, " UNKNOWN COMMAND\n"); return; } -- cgit v1.2.3