summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordhartmei <dhartmei@openbsd.org>2003-04-08 00:04:06 +0000
committerdhartmei <dhartmei@openbsd.org>2003-04-08 00:04:06 +0000
commit5a6e18f40fd22c8006b287d95e062b56b4050129 (patch)
tree05820c0b803576d65d80dd058d7bebe5c14acaba
parentmore string cleaning; ok tedu (diff)
downloadwireguard-openbsd-5a6e18f40fd22c8006b287d95e062b56b4050129.tar.xz
wireguard-openbsd-5a6e18f40fd22c8006b287d95e062b56b4050129.zip
strlcpy conversion, increase buffer size by one char. ok millert@
-rw-r--r--usr.bin/tail/tail.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c
index c483e823a29..6f8c7806ec4 100644
--- a/usr.bin/tail/tail.c
+++ b/usr.bin/tail/tail.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tail.c,v 1.8 2002/02/16 21:27:54 millert Exp $ */
+/* $OpenBSD: tail.c,v 1.9 2003/04/08 00:04:06 dhartmei Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -46,7 +46,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)tail.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tail.c,v 1.8 2002/02/16 21:27:54 millert Exp $";
+static char rcsid[] = "$OpenBSD: tail.c,v 1.9 2003/04/08 00:04:06 dhartmei Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -244,7 +244,7 @@ obsolete(argv)
/* Malloc space for dash, new option and argument. */
len = strlen(*argv);
- if ((start = p = malloc(len + 3)) == NULL)
+ if ((start = p = malloc(len + 4)) == NULL)
err(1, NULL);
*p++ = '-';
@@ -278,7 +278,7 @@ obsolete(argv)
errx(1, "illegal option -- %s", *argv);
}
*p++ = *argv[0];
- (void)strcpy(p, ap);
+ (void)strlcpy(p, ap, start + len + 4 - p);
*argv = start;
continue;