summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2010-01-19 20:34:06 +0100
committerJared Adams <jaxad0127@gmail.com>2010-01-19 18:39:39 +0000
commitdc0c8b2ca0f3867f1b4641092b9f90738ca8c7af (patch)
tree97d4fdd9658f0c9229e7d57bb8b71ef9f889bd62 /src/map/npc.c
parentea5866863cbdad80eb69351417018c6104c5f43b (diff)
downloadtmwa-dc0c8b2ca0f3867f1b4641092b9f90738ca8c7af.tar.gz
tmwa-dc0c8b2ca0f3867f1b4641092b9f90738ca8c7af.tar.bz2
tmwa-dc0c8b2ca0f3867f1b4641092b9f90738ca8c7af.tar.xz
tmwa-dc0c8b2ca0f3867f1b4641092b9f90738ca8c7af.zip
fixed a buffer overrun and use of uninitialized
The target buffer for the memcpy only takes like 24 chars. strcat on an uninitialized buffer is a bad idea.
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 4ff5ba2..edbf548 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -74,7 +74,7 @@ int npc_enable_sub (struct block_list *bl, va_list ap)
if (nd->flag & 1) // ��������������
return 1;
- memcpy (name, nd->name, 50);
+ memcpy (name, nd->name, sizeof(nd->name));
if (sd->areanpc_id == nd->bl.id)
return 1;
sd->areanpc_id = nd->bl.id;