Code

Replace all occurrences of `strcpy' with `sstrncpy'.
[collectd.git] / src / utils_dns.c
index 25ef18998bb9f62ad928130e49b531f71501f15f..3f5d4fb2c3771acab11e394fa52991ee68f4c5f5 100644 (file)
@@ -384,7 +384,7 @@ handle_dns(const char *buf, int len,
     if (0 != x)
        return 0;
     if ('\0' == qh.qname[0])
-       strcpy(qh.qname, ".");
+       strncpy (qh.qname, ".", sizeof (qh.qname));
     while ((t = strchr(qh.qname, '\n')))
        *t = ' ';
     while ((t = strchr(qh.qname, '\r')))