diff --git a/sys/compat/ibcs2/ibcs2_misc.c b/sys/compat/ibcs2/ibcs2_misc.c index 767644f6da15..403852995c46 100644 --- a/sys/compat/ibcs2/ibcs2_misc.c +++ b/sys/compat/ibcs2/ibcs2_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibcs2_misc.c,v 1.63 2003/01/29 07:00:35 atatat Exp $ */ +/* $NetBSD: ibcs2_misc.c,v 1.64 2003/05/16 14:36:30 itojun Exp $ */ /* * Copyright (c) 1994, 1995, 1998 Scott Bartram @@ -55,7 +55,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ibcs2_misc.c,v 1.63 2003/01/29 07:00:35 atatat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibcs2_misc.c,v 1.64 2003/05/16 14:36:30 itojun Exp $"); #include #include @@ -451,7 +451,7 @@ again: idb.d_ino = (ibcs2_ino_t)bdp->d_fileno; idb.d_off = (ibcs2_off_t)off; idb.d_reclen = (u_short)ibcs2_reclen; - strcpy(idb.d_name, bdp->d_name); + strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name)); error = copyout(&idb, outp, ibcs2_reclen); if (error) goto out; diff --git a/sys/compat/irix/irix_dirent.c b/sys/compat/irix/irix_dirent.c index 085cbb771049..51b2e8380f29 100644 --- a/sys/compat/irix/irix_dirent.c +++ b/sys/compat/irix/irix_dirent.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_dirent.c,v 1.8 2003/01/22 12:58:22 rafal Exp $ */ +/* $NetBSD: irix_dirent.c,v 1.9 2003/05/16 14:36:32 itojun Exp $ */ /*- * Copyright (c) 1994, 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: irix_dirent.c,v 1.8 2003/01/22 12:58:22 rafal Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_dirent.c,v 1.9 2003/05/16 14:36:32 itojun Exp $"); #include #include @@ -171,7 +171,7 @@ again: idb.d_ino = (irix_ino_t)bdp->d_fileno; idb.d_off = (irix_off_t)off; idb.d_reclen = (u_short)svr4_reclen; - strcpy(idb.d_name, bdp->d_name); + strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name)); if ((error = copyout((caddr_t)&idb, outp, svr4_reclen))) goto out; /* advance past this real entry */ @@ -324,7 +324,7 @@ again: idb.d_ino = (irix_ino64_t)bdp->d_fileno; idb.d_off = (irix_off64_t)off; idb.d_reclen = (u_short)svr4_reclen; - strcpy(idb.d_name, bdp->d_name); + strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name)); if ((error = copyout((caddr_t)&idb, outp, svr4_reclen))) goto out; /* advance past this real entry */ diff --git a/sys/compat/irix/irix_stat.c b/sys/compat/irix/irix_stat.c index de805a52f257..0c385c512e2e 100644 --- a/sys/compat/irix/irix_stat.c +++ b/sys/compat/irix/irix_stat.c @@ -1,4 +1,4 @@ -/* $NetBSD: irix_stat.c,v 1.7 2003/01/22 12:58:23 rafal Exp $ */ +/* $NetBSD: irix_stat.c,v 1.8 2003/05/16 14:36:32 itojun Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: irix_stat.c,v 1.7 2003/01/22 12:58:23 rafal Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irix_stat.c,v 1.8 2003/05/16 14:36:32 itojun Exp $"); #include #include @@ -90,7 +90,7 @@ bsd_to_irix_stat(bsp, isp) isp->ist_size = bsp->st_size; isp->ist_blocks = bsp->st_blocks; isp->ist_blksize = bsp->st_blksize; - strcpy(isp->ist_fstype, "unknown"); + strlcpy(isp->ist_fstype, "unknown", sizeof(isp->ist_fstype)); return; } @@ -122,7 +122,7 @@ bsd_to_irix_stat64(bsp, isp) isp->ist_size = bsp->st_size; isp->ist_blocks = bsp->st_blocks; isp->ist_blksize = bsp->st_blksize; - strcpy(isp->ist_fstype, "unknown"); + strlcpy(isp->ist_fstype, "unknown", sizeof(isp->ist_fstype)); return; } diff --git a/sys/compat/mach/mach_bootstrap.c b/sys/compat/mach/mach_bootstrap.c index 34de4628ad8e..e3c7b129bbb7 100644 --- a/sys/compat/mach/mach_bootstrap.c +++ b/sys/compat/mach/mach_bootstrap.c @@ -1,4 +1,4 @@ -/* $NetBSD: mach_bootstrap.c,v 1.5 2003/01/21 04:06:07 matt Exp $ */ +/* $NetBSD: mach_bootstrap.c,v 1.6 2003/05/16 14:36:33 itojun Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mach_bootstrap.c,v 1.5 2003/01/21 04:06:07 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mach_bootstrap.c,v 1.6 2003/05/16 14:36:33 itojun Exp $"); #include #include @@ -59,7 +59,7 @@ mach_bootstrap_look_up(args) mach_bootstrap_look_up_reply_t *rep = args->rmsg; struct lwp *l = args->l; size_t *msglen = args->rsize; - const char service_name[] = "lookup\21"; /* XXX Why */ + const char service_name[] = "lookup\021"; /* XXX Why */ int service_name_len; struct mach_right *mr; @@ -79,7 +79,8 @@ mach_bootstrap_look_up(args) rep->rep_msgh.msgh_id = req->req_msgh.msgh_id + 100; rep->rep_count = 1; /* XXX Why? */ rep->rep_bootstrap_port = mr->mr_name; - strcpy((char *)&rep->rep_service_name, service_name); + strlcpy((char *)&rep->rep_service_name, service_name, + sizeof(rep->rep_service_name)); /* XXX This is the trailer. We should find something better */ rep->rep_service_name[service_name_len + 7] = 8; diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c index 62119db538d0..ae25ac71bcf5 100644 --- a/sys/compat/sunos/sunos_misc.c +++ b/sys/compat/sunos/sunos_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos_misc.c,v 1.120 2003/02/23 14:37:32 pk Exp $ */ +/* $NetBSD: sunos_misc.c,v 1.121 2003/05/16 14:36:33 itojun Exp $ */ /* * Copyright (c) 1992, 1993 @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.120 2003/02/23 14:37:32 pk Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.121 2003/05/16 14:36:33 itojun Exp $"); #if defined(_KERNEL_OPT) #include "opt_nfsserver.h" @@ -577,7 +577,7 @@ again: idb.d_off = off; idb.d_reclen = sunos_reclen; idb.d_namlen = bdp->d_namlen; - strcpy(idb.d_name, bdp->d_name); + strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name)); if ((error = copyout((caddr_t)&idb, outp, sunos_reclen)) != 0) goto out; /* advance past this real entry */ diff --git a/sys/compat/sunos32/sunos32_misc.c b/sys/compat/sunos32/sunos32_misc.c index 2f4339d772c8..56a8888881b5 100644 --- a/sys/compat/sunos32/sunos32_misc.c +++ b/sys/compat/sunos32/sunos32_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos32_misc.c,v 1.17 2003/01/29 07:00:38 atatat Exp $ */ +/* $NetBSD: sunos32_misc.c,v 1.18 2003/05/16 14:36:34 itojun Exp $ */ /* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp */ /* @@ -83,7 +83,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.17 2003/01/29 07:00:38 atatat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.18 2003/05/16 14:36:34 itojun Exp $"); #define COMPAT_SUNOS 1 @@ -795,7 +795,7 @@ again: idb.d_off = off; idb.d_reclen = sunos_reclen; idb.d_namlen = bdp->d_namlen; - strcpy(idb.d_name, bdp->d_name); + strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name)); if ((error = copyout((caddr_t)&idb, outp, sunos_reclen)) != 0) goto out; /* advance past this real entry */ diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index e306cfd9bde3..65d789129e91 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_misc.c,v 1.103 2003/04/01 01:55:09 thorpej Exp $ */ +/* $NetBSD: svr4_misc.c,v 1.104 2003/05/16 14:36:35 itojun Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: svr4_misc.c,v 1.103 2003/04/01 01:55:09 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_misc.c,v 1.104 2003/05/16 14:36:35 itojun Exp $"); #include #include @@ -345,7 +345,7 @@ again: idb.d_ino = (svr4_ino64_t)bdp->d_fileno; idb.d_off = (svr4_off64_t)off; idb.d_reclen = (u_short)svr4_reclen; - strcpy(idb.d_name, bdp->d_name); + strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name)); if ((error = copyout((caddr_t)&idb, outp, svr4_reclen))) goto out; /* advance past this real entry */ @@ -469,7 +469,7 @@ again: idb.d_ino = (svr4_ino_t)bdp->d_fileno; idb.d_off = (svr4_off_t)off; idb.d_reclen = (u_short)svr4_reclen; - strcpy(idb.d_name, bdp->d_name); + strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name)); if ((error = copyout((caddr_t)&idb, outp, svr4_reclen))) goto out; /* advance past this real entry */ diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c index 22849b7272b0..2e4d96b858d1 100644 --- a/sys/compat/svr4/svr4_stat.c +++ b/sys/compat/svr4/svr4_stat.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_stat.c,v 1.46 2003/01/18 08:44:27 thorpej Exp $ */ +/* $NetBSD: svr4_stat.c,v 1.47 2003/05/16 14:36:35 itojun Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: svr4_stat.c,v 1.46 2003/01/18 08:44:27 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_stat.c,v 1.47 2003/05/16 14:36:35 itojun Exp $"); #include #include @@ -140,7 +140,7 @@ bsd_to_svr4_xstat(st, st4) st4->st_ctim.tv_nsec = st->st_ctimespec.tv_nsec; st4->st_blksize = st->st_blksize; st4->st_blocks = st->st_blocks; - strcpy(st4->st_fstype, "unknown"); + strlcpy(st4->st_fstype, "unknown", sizeof(st4->st_fstype)); } @@ -166,7 +166,7 @@ bsd_to_svr4_stat64(st, st4) st4->st_ctim.tv_nsec = st->st_ctimespec.tv_nsec; st4->st_blksize = st->st_blksize; st4->st_blocks = st->st_blocks; - strcpy(st4->st_fstype, "unknown"); + strlcpy(st4->st_fstype, "unknown", sizeof(st4->st_fstype)); } diff --git a/sys/compat/svr4_32/svr4_32_misc.c b/sys/compat/svr4_32/svr4_32_misc.c index 24134e9b810e..466ea222ea00 100644 --- a/sys/compat/svr4_32/svr4_32_misc.c +++ b/sys/compat/svr4_32/svr4_32_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_misc.c,v 1.18 2003/04/01 01:55:38 thorpej Exp $ */ +/* $NetBSD: svr4_32_misc.c,v 1.19 2003/05/16 14:36:35 itojun Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: svr4_32_misc.c,v 1.18 2003/04/01 01:55:38 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_misc.c,v 1.19 2003/05/16 14:36:35 itojun Exp $"); #include #include @@ -347,7 +347,7 @@ again: idb.d_ino = (svr4_32_ino64_t)bdp->d_fileno; idb.d_off = (svr4_32_off64_t)off; idb.d_reclen = (u_short)svr4_32_reclen; - strcpy(idb.d_name, bdp->d_name); + strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name)); if ((error = copyout((caddr_t)&idb, outp, svr4_32_reclen))) goto out; /* advance past this real entry */ @@ -471,7 +471,7 @@ again: idb.d_ino = (svr4_32_ino_t)bdp->d_fileno; idb.d_off = (svr4_32_off_t)off; idb.d_reclen = (u_short)svr4_reclen; - strcpy(idb.d_name, bdp->d_name); + strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name)); if ((error = copyout((caddr_t)&idb, outp, svr4_reclen))) goto out; /* advance past this real entry */ diff --git a/sys/compat/svr4_32/svr4_32_stat.c b/sys/compat/svr4_32/svr4_32_stat.c index b50a58f10607..7c11cc1dd7f6 100644 --- a/sys/compat/svr4_32/svr4_32_stat.c +++ b/sys/compat/svr4_32/svr4_32_stat.c @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_32_stat.c,v 1.7 2003/01/19 16:47:16 thorpej Exp $ */ +/* $NetBSD: svr4_32_stat.c,v 1.8 2003/05/16 14:36:36 itojun Exp $ */ /*- * Copyright (c) 1994 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: svr4_32_stat.c,v 1.7 2003/01/19 16:47:16 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_32_stat.c,v 1.8 2003/05/16 14:36:36 itojun Exp $"); #include #include @@ -140,7 +140,7 @@ bsd_to_svr4_32_xstat(st, st4) st4->st_ctim.tv_nsec = st->st_ctimespec.tv_nsec; st4->st_blksize = st->st_blksize; st4->st_blocks = st->st_blocks; - strcpy(st4->st_fstype, "unknown"); + strlcpy(st4->st_fstype, "unknown", sizeof(st4->st_fstype)); } @@ -165,7 +165,7 @@ bsd_to_svr4_32_stat64(st, st4) st4->st_ctim.tv_sec = st->st_ctimespec.tv_sec; st4->st_ctim.tv_nsec = st->st_ctimespec.tv_nsec; st4->st_blocks = st->st_blocks; - strcpy(st4->st_fstype, "unknown"); + strlcpy(st4->st_fstype, "unknown", sizeof(st4->st_fstype)); }