diff -ru sbin/mount_nfs.orig/mount_nfs.c sbin/mount_nfs/mount_nfs.c --- sbin/mount_nfs.orig/mount_nfs.c 2004-02-04 15:40:00.000000000 -0200 +++ sbin/mount_nfs/mount_nfs.c 2004-10-26 22:06:54.000000000 -0200 @@ -256,7 +256,7 @@ uid_t last_ruid; last_ruid = -1; - (void)strcpy(realm, KRB_REALM); + strlcpy(realm, KRB_REALM, REALM_SZ); if (sizeof (struct nfsrpc_nickverf) != RPCX_NICKVERF || sizeof (struct nfsrpc_fullblock) != RPCX_FULLBLOCK || ((char *)&ktick.kt) - ((char *)&ktick) != NFSX_UNSIGNED || @@ -335,8 +335,7 @@ break; #ifdef NFSKERB case 'm': - (void)strncpy(realm, optarg, REALM_SZ - 1); - realm[REALM_SZ - 1] = '\0'; + strlcpy(realm, optarg, REALM_SZ); break; #endif case 'N': @@ -500,7 +499,7 @@ */ if (ncd.ncd_authuid != last_ruid) { char buf[512]; - (void)sprintf(buf, "%s%d", + snprintf(buf, sizeof(buf), "%s%d", TKT_ROOT, ncd.ncd_authuid); krb_set_tkt_string(buf); last_ruid = ncd.ncd_authuid; @@ -665,8 +664,7 @@ } else { memmove(&saddr.sin_addr, hp->h_addr, MIN(hp->h_length, sizeof(saddr.sin_addr))); - strncpy(inst, hp->h_name, INST_SZ); - inst[INST_SZ - 1] = '\0'; + strlcpy(inst, hp->h_name, INST_SZ); if (cp = strchr(inst, '.')) *cp = '\0'; }