From dbe87ff772a3aea31757f336f2bfe9ff4bc53973 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Tue, 18 Nov 2025 19:55:15 +0100 Subject: GetPlayersFormula: fixed possible out-of-bounds array access (found by PVS-Studio) --- FICS/formula.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FICS/formula.c b/FICS/formula.c index dd5ff23..740012f 100644 --- a/FICS/formula.c +++ b/FICS/formula.c @@ -68,7 +68,7 @@ PRIVATE char * GetPlayersFormula(player *pWho, int clause) { - if (clause == MAX_FORMULA) + if (clause < 0 || clause >= (int)ARRAY_SIZE(pWho->formulaLines)) return pWho->formula; return pWho->formulaLines[clause]; } -- cgit v1.2.3