Merge branch 'collectd-4.3' into collectd-4.4
[collectd.git] / src / memory.c
index fe3a16e..583f71a 100644 (file)
@@ -109,8 +109,8 @@ static void memory_submit (const char *type_instance, gauge_t value)
        vl.values = values;
        vl.values_len = 1;
        vl.time = time (NULL);
-       strcpy (vl.host, hostname_g);
-       strcpy (vl.plugin, "memory");
+       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+       sstrncpy (vl.plugin, "memory", sizeof (vl.plugin));
        strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
        vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';