From: Marek Schimara Date: Thu, 4 May 2017 09:22:28 +0000 (+0200) Subject: src/rrd_graph_helper.c: fix Coverity CID #32827 Copy into fixed size buffer X-Git-Tag: v1.7.0~4^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F781%2Fhead;p=thirdparty%2Frrdtool-1.x.git src/rrd_graph_helper.c: fix Coverity CID #32827 Copy into fixed size buffer --- diff --git a/src/rrd_graph_helper.c b/src/rrd_graph_helper.c index 21e404de..3f5c832e 100644 --- a/src/rrd_graph_helper.c +++ b/src/rrd_graph_helper.c @@ -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); } }