summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-29 16:15:18 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-29 16:27:00 +0300
commite9cc77486c96b0177dae130a74bafe967569033b (patch)
treec81a627c2595d10ea5304944cf40db61e8957c67 /src/map/pet.c
parentda2e7b9ec12d784ad3baf8eb824cfb0b6d642302 (diff)
downloadhercules-e9cc77486c96b0177dae130a74bafe967569033b.tar.gz
hercules-e9cc77486c96b0177dae130a74bafe967569033b.tar.bz2
hercules-e9cc77486c96b0177dae130a74bafe967569033b.tar.xz
hercules-e9cc77486c96b0177dae130a74bafe967569033b.zip
Fix buffer overflow in pet rename.
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index 71d8d1eb3..256324d29 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -679,7 +679,7 @@ int pet_change_name_ack(struct map_session_data *sd, const char *name, int flag)
aFree(newname);
return 0;
}
- memcpy(pd->pet.name, newname, NAME_LENGTH);
+ safestrncpy(pd->pet.name, newname, NAME_LENGTH);
aFree(newname);
clif->charnameack (0,&pd->bl);
pd->pet.rename_flag = 1;