diff options
author | 2003-12-01 18:25:15 +0000 | |
---|---|---|
committer | 2003-12-01 18:25:15 +0000 | |
commit | 5128fc070e071c4e691e7da6938af1d5dbd93d4e (patch) | |
tree | 63855878d2fd8a5374f8c8cd178cfb918ea7540c | |
parent | Direct mail for most fake users to /dev/null since they should not (diff) | |
download | wireguard-openbsd-5128fc070e071c4e691e7da6938af1d5dbd93d4e.tar.xz wireguard-openbsd-5128fc070e071c4e691e7da6938af1d5dbd93d4e.zip |
Truncate the source string before copying during variable substitution
so we copy the correct number of bytes. Fixes a bug introduced in
revision 1.11. Closes PR 3591
-rw-r--r-- | bin/csh/dol.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/csh/dol.c b/bin/csh/dol.c index 2d2e743c946..fd915043bb9 100644 --- a/bin/csh/dol.c +++ b/bin/csh/dol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dol.c,v 1.13 2003/06/11 21:09:50 deraadt Exp $ */ +/* $OpenBSD: dol.c,v 1.14 2003/12/01 18:25:15 millert Exp $ */ /* $NetBSD: dol.c,v 1.8 1995/09/27 00:38:38 jtc Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)dol.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: dol.c,v 1.13 2003/06/11 21:09:50 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: dol.c,v 1.14 2003/12/01 18:25:15 millert Exp $"; #endif #endif /* not lint */ @@ -721,6 +721,7 @@ setDolp(Char *cp) size_t len = Strlen(cp) + 1 - lhlen + rhlen; np = (Char *) xmalloc(len * sizeof(Char)); + *dp = 0; (void) Strlcpy(np, cp, len); (void) Strlcat(np, rhsub, len); (void) Strlcat(np, dp + lhlen, len); |