summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-08-21 20:57:22 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-08-21 20:57:22 +0000
commitae829059cd406032a788745ba084e8104165a668 (patch)
tree2a3f4298d55ce01a9ecdab90920fb26e1804486f /usr.sbin
parentc59c619b9d5a91305d81d5179b5c9f966ac0580d (diff)
strncpy not safe on overlapping strings
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/cron/env.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/cron/env.c b/usr.sbin/cron/env.c
index d904f6ebd0b..4054f0162f7 100644
--- a/usr.sbin/cron/env.c
+++ b/usr.sbin/cron/env.c
@@ -16,7 +16,7 @@
*/
#if !defined(lint) && !defined(LINT)
-static char rcsid[] = "$Id: env.c,v 1.5 1998/03/30 06:59:44 deraadt Exp $";
+static char rcsid[] = "$Id: env.c,v 1.6 2000/08/21 20:57:21 deraadt Exp $";
#endif
@@ -170,7 +170,7 @@ load_env(envstr, f)
if (val[0] == '\'' || val[0] == '"') {
if (val[len-1] == val[0]) {
val[len-1] = '\0';
- (void) strcpy(val, val+1);
+ memmove(val, val+1, len);
}
}
}