CID 22570: Copy into fixed size buffer (STRING_OVERFLOW)

not only that, but strlcpy is the faster option here, too.
This commit is contained in:
Enno Rehling 2015-10-30 10:57:52 +01:00
parent 2f82cccea1
commit 4ee0f76927

View file

@ -135,7 +135,7 @@ const char *string, int level, const char *section)
for (i = 0; i != mtype->nparameters; ++i) {
if (i != 0)
*c++ = ' ';
c += strlen(strcpy(c, mtype->pnames[i]));
c += strlcpy(c, mtype->pnames[i], sizeof(zNames)-(c-zNames));
}
nrt->vars = _strdup(zNames);
}