]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
src/rrd_daemon.c: fix Coverity CID#32399 Buffer not null terminated
authorMarek Schimara <Marek.Schimara@bull.net>
Wed, 15 Jun 2016 14:40:05 +0000 (16:40 +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_daemon.c

index 9e3596ab0cc7ba55aff001db9e6491ae87c89522..6e8e687ea87ee6873cd562a6d2b195ebcdaa3a13 100644 (file)
@@ -1939,6 +1939,7 @@ static int handle_request_fetch (HANDLER_PROTO) /* {{{ */
         SSTRCAT (linebuf, " ", linebuf_fill);
       SSTRCAT (linebuf, parsed.ds_namv[parsed.field_idx[i]], linebuf_fill);
     }
+    linebuf[sizeof(linebuf) - 1] = 0;
     add_response_info (sock, "DSCount: %lu\n", parsed.field_cnt);
     add_response_info (sock, "DSName: %s\n", linebuf);
   }