X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fapache.c;h=c6bf8addfed4d6918c7345e5839b3a92105a4c3f;hb=068ae14b916aa298995433da83302032c5e57c76;hp=7667f247604b330ace7f4426aef9d659a139c05c;hpb=6b49eec15d421a74935fb1165c3e9fdb80ca838e;p=collectd.git diff --git a/src/apache.c b/src/apache.c index 7667f247..c6bf8add 100644 --- a/src/apache.c +++ b/src/apache.c @@ -198,9 +198,9 @@ 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, "apache"); - strcpy (vl.plugin_instance, ""); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "apache", sizeof (vl.plugin)); + sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)); sstrncpy (vl.type, type, sizeof (vl.type)); if (type_instance != NULL) @@ -221,9 +221,9 @@ static void submit_gauge (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, "apache"); - strcpy (vl.plugin_instance, ""); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "apache", sizeof (vl.plugin)); + sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance)); sstrncpy (vl.type, type, sizeof (vl.type)); if (type_instance != NULL)