Tidying: coverity issues
authorJeremy Harris <jgh146exb@wizmail.org>
Sat, 9 Apr 2016 14:46:12 +0000 (15:46 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sat, 9 Apr 2016 14:46:12 +0000 (15:46 +0100)
src/src/buildconfig.c

index 3a45cac18dcee1a1b346ab6362c18172c0ad0346..4ed2874141548a2e1cb6a6294c550112f36f95fb 100644 (file)
@@ -825,7 +825,11 @@ else if (isgroup)
             strncpy(buffer, ss, sss-ss);
             buffer[sss-ss] = 0;  /* For empty case */
             }
             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;
           pp = buffer + (int)strlen(buffer);
           while (pp > buffer && isspace((unsigned char)pp[-1])) pp--;
           *pp = 0;