From 01be961df98a32f286084db4fc91900cbc3b45ac Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sat, 22 Mar 2025 12:37:48 +0100 Subject: Make Coverity happy --- FICS/playerdb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FICS/playerdb.c b/FICS/playerdb.c index a892e3d..eefdcde 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -2845,8 +2845,11 @@ player_search(int p, char *name) int p1, count; // Exact match with connected player? - if ((p1 = player_find_bylogin(name)) >= 0) + if ((p1 = player_find_bylogin(name)) >= 0) { + if (p1 + 1 >= (int)ARRAY_SIZE(parray)) + return 0; return (p1 + 1); + } // Exact match with registered player? snprintf(pdir, sizeof pdir, "%s/%c", player_dir, name[0]); -- cgit v1.2.3