X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdns.c;h=c04169fec8a4809cb9e7b5516b5011e8d49a6e3a;hb=2c2e9a297f59c110ddd4adef6293fe80f39f15b7;hp=b61d768df73a0705236fd2f11f83274653588736;hpb=2354eda94fa44c8bcb8e39b24b117e7937110224;p=collectd.git diff --git a/src/dns.c b/src/dns.c index b61d768d..c04169fe 100644 --- a/src/dns.c +++ b/src/dns.c @@ -299,10 +299,10 @@ static void submit_counter (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, "dns"); - strncpy (vl.type, type, sizeof (vl.type)); - strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "dns", sizeof (vl.plugin)); + sstrncpy (vl.type, type, sizeof (vl.type)); + sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); plugin_dispatch_values (&vl); } /* void submit_counter */ @@ -318,9 +318,9 @@ static void submit_octets (counter_t queries, counter_t responses) vl.values = values; vl.values_len = 2; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "dns"); - strcpy (vl.type, "dns_octets"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "dns", sizeof (vl.plugin)); + sstrncpy (vl.type, "dns_octets", sizeof (vl.type)); plugin_dispatch_values (&vl); } /* void submit_counter */