From: Marek Schimara Date: Wed, 15 Jun 2016 14:19:16 +0000 (+0200) Subject: src/rrd_graph_helper.c: fix Coverity CID#32401 Buffer not null terminated X-Git-Tag: v1.7.0~42^2~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33564dbf0c5db1dc76e096e23c6659356f550016;p=thirdparty%2Frrdtool-1.x.git src/rrd_graph_helper.c: fix Coverity CID#32401 Buffer not null terminated CWE-170 / https://cwe.mitre.org/data/definitions/170.html --- diff --git a/src/rrd_graph_helper.c b/src/rrd_graph_helper.c index d58bc938..0415af79 100644 --- a/src/rrd_graph_helper.c +++ b/src/rrd_graph_helper.c @@ -935,7 +935,7 @@ int parse_def(enum gf_en gf,parsedargs_t*pa,image_desc_t *const im){ /* and keep a copy of the error */ char original_error[4096]; - strncpy(original_error,rrd_get_error(),sizeof(original_error)); + strncpy(original_error,rrd_get_error(),sizeof(original_error) - 1); /* and clear the error */ rrd_clear_error();