embryo_cc - fix possible buffer overrun

fix CID 1039592
This commit is contained in:
Carsten Haitzler 2014-09-01 19:12:21 +09:00
parent 435a0dda37
commit f440626cf0
1 changed files with 2 additions and 1 deletions

View File

@ -2481,7 +2481,8 @@ declargs(symbol * sym)
case tSYMBOL:
if (argcnt >= sMAXARGS)
error(45); /* too many function arguments */
strcpy(name, ptr); /* save symbol name */
strncpy(name, ptr, sizeof(name) - 1); /* save symbol name */
name[sizeof(name) - 1] = 0;
if (name[0] == PUBLIC_CHAR)
error(56, name); /* function arguments cannot be public */
if (numtags == 0)