From: Ulrich Drepper Date: Sun, 21 Dec 1997 21:15:59 +0000 (+0000) Subject: (internal_nis_getetherent_r): Use strncpy instead of strcpy for X-Git-Tag: cvs/glibc-2_0_6pre5~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8841bd89aa4d8ea17a7444ad1db67d4d0b5c6c23;p=thirdparty%2Fglibc.git (internal_nis_getetherent_r): Use strncpy instead of strcpy for security reasons. --- diff --git a/nis/nss_nis/nis-ethers.c b/nis/nss_nis/nis-ethers.c index 2d08be7967f..27a02fc1665 100644 --- a/nis/nss_nis/nis-ethers.c +++ b/nis/nss_nis/nis-ethers.c @@ -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))