]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
src/rrd_graph_helper.c: fix Coverity CID#32401 Buffer not null terminated
authorMarek Schimara <Marek.Schimara@bull.net>
Wed, 15 Jun 2016 14:19:16 +0000 (16:19 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Thu, 23 Jun 2016 14:32:33 +0000 (16:32 +0200)
        CWE-170 / https://cwe.mitre.org/data/definitions/170.html

src/rrd_graph_helper.c

index d58bc938f5e0155c29049b7d4670d17365812e1d..0415af79ebd1c14f724639ccf1de04fdd2bda2d9 100644 (file)
@@ -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();