aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--FICS/command.c3
1 files changed, 2 insertions, 1 deletions
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;
}