diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-01-08 06:54:17 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-01-08 06:54:17 +0000 |
commit | 93ffd28c1e8b97780c028b3ef1bd8cf2f20c9391 (patch) | |
tree | e33e80fcf4459ca2622157ba3980c90ec7a75ab7 /bin/csh/proc.c | |
parent | 36efa34ab7ac15f8cad3040dc6dd9e79aa2f717c (diff) |
bring in strlcpy and strlcat-like things for dealing with Char types,
this fixes at least 15 buffer overflows; some help from dhartmei.
Anyone want to go do the same in ksh, and help with some of the while
(*s++ = *p++) loops in here?
Diffstat (limited to 'bin/csh/proc.c')
-rw-r--r-- | bin/csh/proc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/csh/proc.c b/bin/csh/proc.c index e4dbfaa0d7c..4c69a71bc10 100644 --- a/bin/csh/proc.c +++ b/bin/csh/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.15 2002/02/19 19:39:35 millert Exp $ */ +/* $OpenBSD: proc.c,v 1.16 2003/01/08 06:54:16 deraadt Exp $ */ /* $NetBSD: proc.c,v 1.9 1995/04/29 23:21:33 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: proc.c,v 1.15 2002/02/19 19:39:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: proc.c,v 1.16 2003/01/08 06:54:16 deraadt Exp $"; #endif #endif /* not lint */ @@ -600,12 +600,12 @@ pads(cp) if (cmdlen >= PMAXLEN) return; if (cmdlen + i >= PMAXLEN) { - (void) Strcpy(cmdp, STRsp3dots); + (void) Strlcpy(cmdp, STRsp3dots, PMAXLEN - i); /* XXX? */ cmdlen = PMAXLEN; cmdp += 4; return; } - (void) Strcpy(cmdp, cp); + (void) Strlcpy(cmdp, cp, PMAXLEN); cmdp += i; cmdlen += i; } |