aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-05-25 23:00:59 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-05-25 23:00:59 +0200
commit409f8c1feffa75a0f06ca01c152398c2e25bba0f (patch)
tree3be26c2073cf3d3446b4f265d33c2ae03777c2f3
parentf56409da53e23e91e00fdac0a653483a0180c9b0 (diff)
Fixed out of bounds array access
-rw-r--r--FICS/command.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/FICS/command.c b/FICS/command.c
index ee9b8d7..1161cfd 100644
--- a/FICS/command.c
+++ b/FICS/command.c
@@ -232,7 +232,8 @@ match_command(char *comm, int p)
i++;
}
- if (in_list(p, L_REMOVEDCOM, command_list[gotIt].comm_name)) {
+ if (gotIt >= 0 &&
+ in_list(p, L_REMOVEDCOM, command_list[gotIt].comm_name)) {
pprintf(p, "Due to a bug - this command has been temporarily "
"removed.\n");
return -COM_FAILED;