diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-12-04 01:43:59 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-12-04 01:43:59 +0100 |
commit | e011c1de858a56d48fed0c3594d2e77e64be67f8 (patch) | |
tree | c2a916bcb2e0da86ce98de0329fb7ee2191a8c8e /FICS | |
parent | 1ead39e269aa3af62cd0f416bd6fb7c5b9b77378 (diff) |
player_save: added player number check
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/playerdb.c | 5 |
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; |