]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(internal_nis_getetherent_r): Use strncpy instead of strcpy for
authorUlrich Drepper <drepper@redhat.com>
Sun, 21 Dec 1997 21:15:59 +0000 (21:15 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 21 Dec 1997 21:15:59 +0000 (21:15 +0000)
security reasons.

nis/nss_nis/nis-ethers.c

index 2d08be7967faf039f066c9aed0125439b38bdd4b..27a02fc16655392f482eb0179c776ddff788dd8e 100644 (file)
@@ -158,7 +158,7 @@ internal_nis_getetherent_r (struct ether *eth, char *buffer, size_t buflen)
 
       if (next == NULL)
        return NSS_STATUS_NOTFOUND;
-      p = strcpy (buffer, next->val);
+      p = strncpy (buffer, next->val, buflen);
       next = next->next;
 
       while (isspace (*p))