From eb5e0490e6a4a2ad1c8ea25469a7541175e5b3db Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 2 Dec 2024 21:02:02 +0100 Subject: Accept number bounds checking --- FICS/matchproc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'FICS') 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) { -- cgit v1.2.3