summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2010-01-19 20:24:19 +0100
committerJared Adams <jaxad0127@gmail.com>2010-01-19 18:39:39 +0000
commit67e82f1a0bc2a9078cfe11e0add190fa7cc4b891 (patch)
treeec2f2134d4c6b1a037c18fb65bdd3ef18a4efb8e /src/map/pc.c
parentabe96e3b05a99a984d6f00098f1aa9759814b542 (diff)
downloadtmwa-67e82f1a0bc2a9078cfe11e0add190fa7cc4b891.tar.gz
tmwa-67e82f1a0bc2a9078cfe11e0add190fa7cc4b891.tar.bz2
tmwa-67e82f1a0bc2a9078cfe11e0add190fa7cc4b891.tar.xz
tmwa-67e82f1a0bc2a9078cfe11e0add190fa7cc4b891.zip
fixed a few buffer overruns
strncpy does not always terminate strings. Unterminated strings (without a length) are bad. So better terminate them.
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 689bcd2..9741852 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -8359,7 +8359,8 @@ int pc_setsavepoint (struct map_session_data *sd, char *mapname, int x, int y)
{
nullpo_retr (0, sd);
- strncpy (sd->status.save_point.map, mapname, 24);
+ strncpy (sd->status.save_point.map, mapname, 23);
+ sd->status.save_point.map[23] = '\0';
sd->status.save_point.x = x;
sd->status.save_point.y = y;