From ae20c80970d513823f3d36e73ec9657bf4b0e197 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sat, 9 Apr 2016 15:46:12 +0100 Subject: [PATCH] Tidying: coverity issues --- src/src/buildconfig.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/src/buildconfig.c b/src/src/buildconfig.c index 3a45cac18..4ed287414 100644 --- a/src/src/buildconfig.c +++ b/src/src/buildconfig.c @@ -825,7 +825,11 @@ else if (isgroup) strncpy(buffer, ss, sss-ss); buffer[sss-ss] = 0; /* For empty case */ } - else strcpy(buffer, ss); + else + { + strncpy(buffer, ss, sizeof(buffer)); + buffer[sizeof(buffer)-1] = 0; + } pp = buffer + (int)strlen(buffer); while (pp > buffer && isspace((unsigned char)pp[-1])) pp--; *pp = 0; -- 2.25.1