src/collectd-tg.c: Explicitly null-terminate string.
authorFlorian Forster <octo@collectd.org>
Tue, 8 Dec 2015 10:46:09 +0000 (11:46 +0100)
committerFlorian Forster <octo@collectd.org>
Tue, 8 Dec 2015 10:46:20 +0000 (11:46 +0100)
CID: 37937
Signed-off-by: Florian Forster <octo@collectd.org>
src/collectd-tg.c

index 9fec340..9857f92 100644 (file)
@@ -183,6 +183,7 @@ static lcc_value_list_t *create_value_list (void) /* {{{ */
   strncpy (vl->identifier.type,
       (vl->values_types[0] == LCC_TYPE_GAUGE) ? "gauge" : "derive",
       sizeof (vl->identifier.type));
+  vl->identifier.type[sizeof (vl->identifier.type) - 1] = 0;
   snprintf (vl->identifier.type_instance, sizeof (vl->identifier.type_instance),
       "ti%li", random ());