summaryrefslogtreecommitdiff
path: root/sys/kern/exec_script.c
diff options
context:
space:
mode:
authoritojun <itojun@NetBSD.org>2003-05-16 14:25:02 +0000
committeritojun <itojun@NetBSD.org>2003-05-16 14:25:02 +0000
commitf265a4a4daa50c3df643787930185e8b3d4def23 (patch)
tree672d5fe0c22982f8fb25df7290b49944a2431798 /sys/kern/exec_script.c
parent4c6da4d976cb9a95cb46420753164c6292dad83c (diff)
use strlcpy. [fixed off-by-one in subr_prop.c]
Diffstat (limited to 'sys/kern/exec_script.c')
-rw-r--r--sys/kern/exec_script.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/exec_script.c b/sys/kern/exec_script.c
index 521cbf969fb..06962abca31 100644
--- a/sys/kern/exec_script.c
+++ b/sys/kern/exec_script.c
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_script.c,v 1.33 2003/04/02 01:00:20 perry Exp $ */
+/* $NetBSD: exec_script.c,v 1.34 2003/05/16 14:25:03 itojun Exp $ */
/*
* Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.33 2003/04/02 01:00:20 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.34 2003/05/16 14:25:03 itojun Exp $");
#if defined(SETUIDSCRIPTS) && !defined(FDSCRIPTS)
#define FDSCRIPTS /* Need this for safe set-id scripts. */
@@ -205,10 +205,10 @@ check_shell:
MALLOC(shellargp, char **, 4 * sizeof(char *), M_EXEC, M_WAITOK);
tmpsap = shellargp;
MALLOC(*tmpsap, char *, shellnamelen + 1, M_EXEC, M_WAITOK);
- strcpy(*tmpsap++, shellname);
+ strlcpy(*tmpsap++, shellname, shellnamelen + 1);
if (shellarg != NULL) {
MALLOC(*tmpsap, char *, shellarglen + 1, M_EXEC, M_WAITOK);
- strcpy(*tmpsap++, shellarg);
+ strlcpy(*tmpsap++, shellarg, shellarglen + 1);
}
MALLOC(*tmpsap, char *, MAXPATHLEN, M_EXEC, M_WAITOK);
#ifdef FDSCRIPTS