From e011c1de858a56d48fed0c3594d2e77e64be67f8 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Wed, 4 Dec 2024 01:43:59 +0100 Subject: player_save: added player number check --- FICS/playerdb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/FICS/playerdb.c b/FICS/playerdb.c index 084a1e7..f17593a 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -1211,6 +1211,11 @@ player_save(int p) FILE *fp; char fname[MAX_FILENAME_SIZE]; + if (!player_num_ok_chk(p)) { + warnx("%s: invalid player number %d", __func__, p); + return -1; + } + if (!parray[p].registered) // Player must not be registered return -1; -- cgit v1.2.3