aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-05-19 22:03:09 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-05-19 22:03:09 +0200
commit459d4ea80249c57cfb70cab1a5941655fddbea0a (patch)
tree6156373a3c7bc2ef14d079e15efd1283b7cc9e9e
parent64b52be7a7603b6d044a45fe878016df71986c0d (diff)
Replaced the strcpy() calls
-rw-r--r--FICS/adminproc.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/FICS/adminproc.c b/FICS/adminproc.c
index 1f55545..8f81448 100644
--- a/FICS/adminproc.c
+++ b/FICS/adminproc.c
@@ -856,7 +856,7 @@ com_remplayer(int p, param_list param)
ASSERT(parray[p].adminLevel >= ADMIN_ADMIN);
- strcpy(playerlower, player);
+ mstrlcpy(playerlower, player, sizeof(playerlower));
stolower(playerlower);
p1 = player_new();
lookup = player_read(p1, playerlower);
@@ -919,7 +919,7 @@ com_raisedead(int p, param_list param)
ASSERT(parray[p].adminLevel >= ADMIN_ADMIN);
- strcpy(playerlower, player);
+ mstrlcpy(playerlower, player, sizeof playerlower);
stolower(playerlower);
if (player_find_bylogin(playerlower) >= 0) {
@@ -970,7 +970,7 @@ com_raisedead(int p, param_list param)
} else {
char *newplayer = param[1].val.word;
- strcpy(newplayerlower, newplayer);
+ mstrlcpy(newplayerlower, newplayer, sizeof newplayerlower);
stolower(newplayerlower);
if (player_find_bylogin(newplayerlower) >= 0) {
@@ -1067,7 +1067,7 @@ com_addplayer(int p, param_list param)
return COM_OK;
}
- strcpy(newplayerlower, newplayer);
+ mstrlcpy(newplayerlower, newplayer, sizeof newplayerlower);
stolower(newplayerlower);
p1 = player_new();
@@ -1089,7 +1089,7 @@ com_addplayer(int p, param_list param)
password[i] = ('a' + arc4random_uniform(26));
password[i] = '\0';
- strcpy(salt, fics_getsalt());
+ mstrlcpy(salt, fics_getsalt(), sizeof salt);
parray[p1].passwd = xstrdup(crypt(password, salt));
} else {
@@ -1354,7 +1354,7 @@ com_asetpasswd(int p, param_list param)
"Your account at our FICS has been locked.\n",
parray[p1].name);
} else {
- strcpy(salt, fics_getsalt());
+ mstrlcpy(salt, fics_getsalt(), sizeof salt);
parray[p1].passwd = xstrdup(crypt(param[1].val.word, salt));
@@ -1523,9 +1523,10 @@ com_asethandle(int p, param_list param)
ASSERT(parray[p].adminLevel >= ADMIN_ADMIN);
- strcpy(playerlower, player);
+ mstrlcpy(playerlower, player, sizeof playerlower);
stolower(playerlower);
- strcpy(newplayerlower, newplayer);
+
+ mstrlcpy(newplayerlower, newplayer, sizeof newplayerlower);
stolower(newplayerlower);
if (player_find_bylogin(playerlower) >= 0) {