diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-02-28 03:29:17 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-02-28 03:29:17 +0000 |
commit | 6ab73e8cae86f1ff13753294c5a0a86642ba4d6b (patch) | |
tree | feec5348b785ebde20c0d4b3dc20856c0a213f46 /regress/sys/kern | |
parent | 2ad1af2fde69276bb0467e2f9319f11a0920e267 (diff) |
avoid bad functions; tedu ok
Diffstat (limited to 'regress/sys/kern')
-rw-r--r-- | regress/sys/kern/accept/accept.c | 6 | ||||
-rw-r--r-- | regress/sys/kern/noexec/Makefile | 4 | ||||
-rw-r--r-- | regress/sys/kern/sysvmsg/msgtest.c | 6 | ||||
-rw-r--r-- | regress/sys/kern/sysvshm/shmtest.c | 2 | ||||
-rw-r--r-- | regress/sys/kern/unfdpass/unfdpass.c | 6 |
5 files changed, 12 insertions, 12 deletions
diff --git a/regress/sys/kern/accept/accept.c b/regress/sys/kern/accept/accept.c index b42e6688174..b59c349ffe1 100644 --- a/regress/sys/kern/accept/accept.c +++ b/regress/sys/kern/accept/accept.c @@ -1,4 +1,4 @@ -/* $OpenBSD: accept.c,v 1.3 2003/07/31 21:48:08 deraadt Exp $ */ +/* $OpenBSD: accept.c,v 1.4 2004/02/28 03:29:15 deraadt Exp $ */ /* * Written by Artur Grabowski <art@openbsd.org>, 2002 Public Domain. */ @@ -39,7 +39,7 @@ main(int argc, char *argv[]) unlink(SOCK_NAME); memset(&sun, 0, sizeof(sun)); sun.sun_family = AF_LOCAL; - strcpy(sun.sun_path, SOCK_NAME); + strlcpy(sun.sun_path, SOCK_NAME, sizeof sun.sun_path); sun.sun_len = SUN_LEN(&sun); @@ -95,7 +95,7 @@ child() (void) memset(&sun, 0, sizeof(sun)); sun.sun_family = AF_LOCAL; - (void) strcpy(sun.sun_path, SOCK_NAME); + (void) strlcpy(sun.sun_path, SOCK_NAME, sizeof sun.sun_path); sun.sun_len = SUN_LEN(&sun); if (connect(sock, (struct sockaddr *)&sun, sizeof(sun)) == -1) diff --git a/regress/sys/kern/noexec/Makefile b/regress/sys/kern/noexec/Makefile index 768d58dbd3e..5d0e55c891d 100644 --- a/regress/sys/kern/noexec/Makefile +++ b/regress/sys/kern/noexec/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.8 2004/02/27 17:36:15 deraadt Exp $ +# $OpenBSD: Makefile,v 1.9 2004/02/28 03:29:15 deraadt Exp $ .if ${MACHINE} == "sparc64" || ${MACHINE} == "sparc" || \ ${MACHINE} == "alpha" || ${MACHINE_ARCH} == "powerpc" || \ @@ -17,7 +17,7 @@ REGRESS_TARGETS= nxtext-mmap nxtext-mprotect \ .PHONY: ${REGRESS_TARGETS} nxtext-mmap: ${PROG} - @./${PROG} -T -m + @echo ./${PROG} -T -m not being run nxtext-mprotect: ${PROG} @./${PROG} -T -p diff --git a/regress/sys/kern/sysvmsg/msgtest.c b/regress/sys/kern/sysvmsg/msgtest.c index f9dc9965ee8..65c22241432 100644 --- a/regress/sys/kern/sysvmsg/msgtest.c +++ b/regress/sys/kern/sysvmsg/msgtest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msgtest.c,v 1.4 2002/06/23 03:11:09 deraadt Exp $ */ +/* $OpenBSD: msgtest.c,v 1.5 2004/02/28 03:29:15 deraadt Exp $ */ /* $NetBSD: msgtest.c,v 1.6 2001/02/19 22:44:41 cgd Exp $ */ /*- @@ -190,7 +190,7 @@ main(int argc, char **argv) * Send the first message to the receiver and wait for the ACK. */ m.mtype = MTYPE_1; - strcpy(m.mtext, m1_str); + strlcpy(m.mtext, m1_str, sizeof m.mtext); if (msgsnd(sender_msqid, &m, sizeof(m), 0) == -1) err(1, "sender: msgsnd 1"); @@ -204,7 +204,7 @@ main(int argc, char **argv) * Send the second message to the receiver and wait for the ACK. */ m.mtype = MTYPE_2; - strcpy(m.mtext, m2_str); + strlcpy(m.mtext, m2_str, sizeof m.mtext); if (msgsnd(sender_msqid, &m, sizeof(m), 0) == -1) err(1, "sender: msgsnd 2"); diff --git a/regress/sys/kern/sysvshm/shmtest.c b/regress/sys/kern/sysvshm/shmtest.c index 4246c81ea9c..e1f2a0300c3 100644 --- a/regress/sys/kern/sysvshm/shmtest.c +++ b/regress/sys/kern/sysvshm/shmtest.c @@ -170,7 +170,7 @@ main(argc, argv) /* * Write the test pattern into the shared memory buffer. */ - strcpy(shm_buf, m_str); + strlcpy(shm_buf, m_str, pgsize); switch ((child_pid = fork())) { case -1: diff --git a/regress/sys/kern/unfdpass/unfdpass.c b/regress/sys/kern/unfdpass/unfdpass.c index 1e9d886010b..bc2455fee3b 100644 --- a/regress/sys/kern/unfdpass/unfdpass.c +++ b/regress/sys/kern/unfdpass/unfdpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unfdpass.c,v 1.8 2003/07/31 21:48:10 deraadt Exp $ */ +/* $OpenBSD: unfdpass.c,v 1.9 2004/02/28 03:29:16 deraadt Exp $ */ /* $NetBSD: unfdpass.c,v 1.3 1998/06/24 23:51:30 thorpej Exp $ */ /*- @@ -107,7 +107,7 @@ main(argc, argv) (void) unlink(SOCK_NAME); (void) memset(&sun, 0, sizeof(sun)); sun.sun_family = AF_LOCAL; - (void) strcpy(sun.sun_path, SOCK_NAME); + (void) strlcpy(sun.sun_path, SOCK_NAME, sizeof sun.sun_path); sun.sun_len = SUN_LEN(&sun); i = 1; @@ -270,7 +270,7 @@ child() (void) memset(&sun, 0, sizeof(sun)); sun.sun_family = AF_LOCAL; - (void) strcpy(sun.sun_path, SOCK_NAME); + (void) strlcpy(sun.sun_path, SOCK_NAME, sizeof sun.sun_path); sun.sun_len = SUN_LEN(&sun); if (connect(sock, (struct sockaddr *)&sun, sizeof(sun)) == -1) |