X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmysql.c;h=aa585d6554eb88ddedffb8f38f5286b386deeba6;hb=acc28b296c39e3d2e970f62331088e0868cf8998;hp=d4728531027be022e8ad9d6a57994a06711785d8;hpb=c8ec3924c92ad3ca15229e8e923eaece64221337;p=collectd.git diff --git a/src/mysql.c b/src/mysql.c index d4728531..aa585d65 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -126,8 +126,8 @@ static void counter_submit (const char *type, const char *type_instance, vl.values = values; vl.values_len = 1; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "mysql"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin)); strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); plugin_dispatch_values (type, &vl); @@ -149,8 +149,8 @@ static void qcache_submit (counter_t hits, counter_t inserts, vl.values = values; vl.values_len = 5; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "mysql"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin)); plugin_dispatch_values ("mysql_qcache", &vl); } /* void qcache_submit */ @@ -169,8 +169,8 @@ static void threads_submit (gauge_t running, gauge_t connected, gauge_t cached, vl.values = values; vl.values_len = 4; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "mysql"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin)); plugin_dispatch_values ("mysql_threads", &vl); } /* void threads_submit */ @@ -186,8 +186,8 @@ static void traffic_submit (counter_t rx, counter_t tx) vl.values = values; vl.values_len = 2; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "mysql"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin)); plugin_dispatch_values ("mysql_octets", &vl); } /* void traffic_submit */