X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fiptables.c;h=4d15c6e0896ac62e15b3082fb6c622403c4add2d;hb=aac35f0faf646c9e20d34aea54d43ed6efe194a1;hp=dc69f6be49c4e85c1d8522b0b00ec7201733778c;hpb=47faf00c18402cefd0e195d63ad48d5e7e6a4a92;p=collectd.git diff --git a/src/iptables.c b/src/iptables.c index dc69f6be..4d15c6e0 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -219,8 +219,8 @@ static int submit_match (const struct ipt_entry_match *match, vl.values = values; vl.values_len = 1; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "iptables"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "iptables", sizeof (vl.plugin)); status = ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance), "%s-%s", chain->table, chain->chain); @@ -241,11 +241,11 @@ static int submit_match (const struct ipt_entry_match *match, sizeof (vl.type_instance)); } - strcpy (vl.type, "ipt_bytes"); + sstrncpy (vl.type, "ipt_bytes", sizeof (vl.type)); values[0].counter = (counter_t) entry->counters.bcnt; plugin_dispatch_values (&vl); - strcpy (vl.type, "ipt_packets"); + sstrncpy (vl.type, "ipt_packets", sizeof (vl.type)); values[0].counter = (counter_t) entry->counters.pcnt; plugin_dispatch_values (&vl);