diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-12-02 21:02:02 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-12-02 21:02:02 +0100 |
commit | eb5e0490e6a4a2ad1c8ea25469a7541175e5b3db (patch) | |
tree | 351b3698d914a226974e73049cfdbdf10b605a90 | |
parent | 47ee7e8870884e01a3b5bef63094d30cbae59d52 (diff) |
Accept number bounds checking
-rw-r--r-- | FICS/matchproc.c | 5 |
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) { |