]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
src/rrd_create.c: fix Coverity CID#32427 Copy into fixed size buffer (buffer overflow)
authorMarek Schimara <Marek.Schimara@bull.net>
Tue, 14 Jun 2016 14:55:25 +0000 (16:55 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Thu, 23 Jun 2016 14:32:32 +0000 (16:32 +0200)
        CWE-120 / https://cwe.mitre.org/data/definitions/120.html

src/rrd_create.c

index c4a803c5141d1ef948358473a107fa6106820c5c..ac5c8ff4f5a2cf97dad9c9561e2b5a36166fd395 100644 (file)
@@ -948,7 +948,7 @@ int rrd_create_r2(
     // parsing went well. ONLY THEN are we allowed to produce
     // additional side effects.
     if (require_version != NULL) {
-        strcpy(rrd.stat_head->version, require_version);
+        strncpy(rrd.stat_head->version, require_version, 5);
     }
 
     if (rrd.stat_head->rra_cnt < 1) {