From: Florian Forster Date: Tue, 8 Dec 2015 10:46:09 +0000 (+0100) Subject: src/collectd-tg.c: Explicitly null-terminate string. X-Git-Tag: collectd-5.5.1~13^2~16 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3bca8a6cdbb7d6d25489eaf13ac1387c257ae681;p=collectd.git src/collectd-tg.c: Explicitly null-terminate string. CID: 37937 Signed-off-by: Florian Forster --- 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 ());