diff options
author | Helmut Grohne <helmut@subdivi.de> | 2010-01-19 20:34:06 +0100 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-01-19 18:39:39 +0000 |
commit | dc0c8b2ca0f3867f1b4641092b9f90738ca8c7af (patch) | |
tree | 97d4fdd9658f0c9229e7d57bb8b71ef9f889bd62 /src/map/npc.c | |
parent | ea5866863cbdad80eb69351417018c6104c5f43b (diff) | |
download | tmwa-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.c | 2 |
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; |