X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fapache.c;h=c6bf8addfed4d6918c7345e5839b3a92105a4c3f;hb=074b4980bc75bea6826e6a38dcc6e193a721b2a8;hp=7667f247604b330ace7f4426aef9d659a139c05c;hpb=47faf00c18402cefd0e195d63ad48d5e7e6a4a92;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)