aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-12-04 01:43:59 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-12-04 01:43:59 +0100
commite011c1de858a56d48fed0c3594d2e77e64be67f8 (patch)
treec2a916bcb2e0da86ce98de0329fb7ee2191a8c8e /FICS
parent1ead39e269aa3af62cd0f416bd6fb7c5b9b77378 (diff)
player_save: added player number check
Diffstat (limited to 'FICS')
-rw-r--r--FICS/playerdb.c5
1 files changed, 5 insertions, 0 deletions
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;