From 4ee0f76927449b58ff37c2cec73634312bb47b5c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 30 Oct 2015 10:57:52 +0100 Subject: [PATCH] CID 22570: Copy into fixed size buffer (STRING_OVERFLOW) not only that, but strlcpy is the faster option here, too. --- src/util/nrmessage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/nrmessage.c b/src/util/nrmessage.c index 640cb81e6..e3b0bcc0b 100644 --- a/src/util/nrmessage.c +++ b/src/util/nrmessage.c @@ -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); }