aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/matchproc.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-12-02 21:02:02 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-12-02 21:02:02 +0100
commiteb5e0490e6a4a2ad1c8ea25469a7541175e5b3db (patch)
tree351b3698d914a226974e73049cfdbdf10b605a90 /FICS/matchproc.c
parent47ee7e8870884e01a3b5bef63094d30cbae59d52 (diff)
Accept number bounds checking
Diffstat (limited to 'FICS/matchproc.c')
-rw-r--r--FICS/matchproc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/FICS/matchproc.c b/FICS/matchproc.c
index adbe5df..88e2bd9 100644
--- a/FICS/matchproc.c
+++ b/FICS/matchproc.c
@@ -1206,6 +1206,11 @@ com_accept(int p, param_list param)
}
}
+ if (acceptNum < 0 || acceptNum >= ARRAY_SIZE(parray[0].p_from_list)) {
+ pprintf(p, "Accept number out-of-bounds!\n");
+ return COM_FAILED;
+ }
+
from = parray[p].p_from_list[acceptNum].whofrom;
switch (parray[p].p_from_list[acceptNum].type) {