X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fiptables.c;h=4d15c6e0896ac62e15b3082fb6c622403c4add2d;hb=7471e073bff7c9f2542bc1c8ce639b85c5498ba7;hp=576cd63eabc0836d123c686dfde21405d7a18dcb;hpb=cacaa2126020832df99fa6423147bd3de6d4faae;p=collectd.git diff --git a/src/iptables.c b/src/iptables.c index 576cd63e..4d15c6e0 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -25,7 +25,9 @@ #include "plugin.h" #include "configfile.h" -#if HAVE_LIBIPTC_LIBIPTC_H +#if OWN_LIBIPTC +# include "libiptc/libiptc.h" +#else # include #endif @@ -217,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); @@ -239,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);