embryo_cc - fix possible buffer overrun

fix CID 1039588
This commit is contained in:
Carsten Haitzler 2014-09-01 18:57:07 +09:00
parent ea3d28d0c3
commit 1f5aa3050b
1 changed files with 2 additions and 1 deletions

View File

@ -2693,7 +2693,8 @@ addsym(char *name, cell addr, int ident, int vclass, int tag, int usage)
*refer = NULL;
/* first fill in the entry */
strcpy(entry.name, name);
strncpy(entry.name, name, sizeof(entry.name) - 1);
entry.name[sizeof(entry.name) - 1] = 0;
entry.hash = namehash(name);
entry.addr = addr;
entry.vclass = (char)vclass;