]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
src/rrd_graph_helper.c: fix Coverity CID #32827 Copy into fixed size buffer 781/head
authorMarek Schimara <Marek.Schimara@bull.net>
Thu, 4 May 2017 09:22:28 +0000 (11:22 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Thu, 4 May 2017 09:56:42 +0000 (11:56 +0200)
src/rrd_graph_helper.c

index 21e404dede94d5652ad4ae85148e93bd6f685acd..3f5c832efc218d4a0aa85aa921d0ea5f112e8ba5 100644 (file)
@@ -515,7 +515,9 @@ static graph_desc_t* newGraphDescription(image_desc_t *const im,enum gf_en gf,pa
   if (bitscmp(PARSE_DAEMON)) {
     char *daemon=getKeyValueArgument("daemon",1,pa);
     if (daemon) {
-      strncpy(gdp->daemon,daemon,strlen(daemon));
+      /* graph_desc_t: char daemon[256] */
+      strncpy(gdp->daemon,daemon,255);
+      gdp->daemon[255] = '\0';
       dprintfparsed("got daemon: %s\n", gdp->daemon);
     }
   }