embryo_cc - fix possible buffer overrun

fix CID 1039591
This commit is contained in:
Carsten Haitzler 2014-09-01 19:10:48 +09:00
parent 88fda07299
commit 435a0dda37
1 changed files with 2 additions and 1 deletions

View File

@ -2637,7 +2637,8 @@ doarg(char *name, int ident, int offset, int tags[], int numtags,
cell size;
int idxtag[sDIMEN_MAX];
strcpy(arg->name, name);
strncpy(arg->name, name, sizeof(arg->name) - 1);
arg->name[sizeof(arg->name) - 1] = 0;
arg->hasdefault = FALSE; /* preset (most common case) */
arg->defvalue.val = 0; /* clear */
arg->defvalue_tag = 0;