From 3bca8a6cdbb7d6d25489eaf13ac1387c257ae681 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 8 Dec 2015 11:46:09 +0100 Subject: [PATCH] src/collectd-tg.c: Explicitly null-terminate string. CID: 37937 Signed-off-by: Florian Forster --- src/collectd-tg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/collectd-tg.c b/src/collectd-tg.c index 9fec3402..9857f92e 100644 --- a/src/collectd-tg.c +++ b/src/collectd-tg.c @@ -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 ()); -- 2.30.2