summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2015-01-18 11:37:45 -0200
committershennetsind <ind@henn.et>2015-01-18 11:37:45 -0200
commitd0725afa8363b5f7b0612e087b48013d39339039 (patch)
tree3f521b45f4b0f0d3e7dee31cacfdd78d7be867ab /src/map/chrif.c
parenta3c4d675ba19df385be5d1e3966c61de7186da57 (diff)
downloadhercules-d0725afa8363b5f7b0612e087b48013d39339039.tar.gz
hercules-d0725afa8363b5f7b0612e087b48013d39339039.tar.bz2
hercules-d0725afa8363b5f7b0612e087b48013d39339039.tar.xz
hercules-d0725afa8363b5f7b0612e087b48013d39339039.zip
Fixing 38 issues
Addressing out of bounds read/write, pointless null checks on already deferenced variables, dead code. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index a5003ab95..153216cef 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -952,14 +952,14 @@ void chrif_idbanned(int fd) {
time_t timestamp;
char tmpstr[2048];
timestamp = (time_t)RFIFOL(fd,7); // status or final date of a banishment
- strcpy(tmpstr, msg_txt(423)); //"Your account has been banished until "
+ safestrncpy(tmpstr, msg_txt(423), sizeof(tmpstr)); //"Your account has been banished until "
strftime(tmpstr + strlen(tmpstr), 24, "%d-%m-%Y %H:%M:%S", localtime(&timestamp));
clif->message(sd->fd, tmpstr);
} else if (RFIFOB(fd,6) == 2) { // 2: change of status for character
time_t timestamp;
char tmpstr[2048];
timestamp = (time_t)RFIFOL(fd,7); // status or final date of a banishment
- strcpy(tmpstr, msg_txt(433)); //"This character has been banned until "
+ safestrncpy(tmpstr, msg_txt(433), sizeof(tmpstr)); //"This character has been banned until "
strftime(tmpstr + strlen(tmpstr), 24, "%d-%m-%Y %H:%M:%S", localtime(&timestamp));
clif->message(sd->fd, tmpstr);
}