summaryrefslogtreecommitdiff
path: root/usr.bin/telnet
diff options
context:
space:
mode:
authorHans Insulander <hin@cvs.openbsd.org>2003-04-03 12:05:59 +0000
committerHans Insulander <hin@cvs.openbsd.org>2003-04-03 12:05:59 +0000
commit448414f170f311452f7117c6fdee8addb9964a55 (patch)
tree5985aafeee6c66fd128fbae71c50424316ebdc06 /usr.bin/telnet
parent7bf1f7730951cca007e18a5cb600dbfd7418da34 (diff)
strcpy -> strlcpy
strcat -> strlcat ok millert@
Diffstat (limited to 'usr.bin/telnet')
-rw-r--r--usr.bin/telnet/commands.c10
-rw-r--r--usr.bin/telnet/tn3270.c10
-rw-r--r--usr.bin/telnet/utilities.c4
3 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index 2e189523064..55d5755224a 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commands.c,v 1.42 2002/06/12 06:07:16 mpech Exp $ */
+/* $OpenBSD: commands.c,v 1.43 2003/04/03 12:05:58 hin Exp $ */
/* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */
/*
@@ -101,7 +101,7 @@ makeargv()
margc = 0;
cp = line;
if (*cp == '!') { /* Special case shell escape */
- strcpy(saveline, line); /* save for shell command */
+ strlcpy(saveline, line, sizeof(saveline)); /* save for shell command */
*argp++ = "!"; /* No room in string to get this */
margc++;
cp++;
@@ -2293,7 +2293,7 @@ tn(argc, argv)
return 0;
}
if (argc < 2) {
- (void) strcpy(line, "open ");
+ strlcpy(line, "open ", sizeof(line));
printf("(to) ");
(void) fgets(&line[strlen(line)], sizeof(line) - strlen(line), stdin);
makeargv();
@@ -2397,7 +2397,7 @@ tn(argc, argv)
if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf),
NULL, 0, niflags) != 0) {
- strcpy(hbuf, "(invalid)");
+ strlcpy(hbuf, "(invalid)", sizeof(hbuf));
}
printf("Trying %s...\r\n", hbuf);
}
@@ -2457,7 +2457,7 @@ tn(argc, argv)
if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf),
NULL, 0, niflags) != 0) {
- strcpy(hbuf, "(invalid)");
+ strlcpy(hbuf, "(invalid)", sizeof(hbuf));
}
fprintf(stderr, "telnet: connect to address %s: %s\n", hbuf,
strerror(errno));
diff --git a/usr.bin/telnet/tn3270.c b/usr.bin/telnet/tn3270.c
index bf31a940fc0..fb9cf0bd516 100644
--- a/usr.bin/telnet/tn3270.c
+++ b/usr.bin/telnet/tn3270.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tn3270.c,v 1.4 2001/11/19 19:02:16 mpech Exp $ */
+/* $OpenBSD: tn3270.c,v 1.5 2003/04/03 12:05:58 hin Exp $ */
/* $NetBSD: tn3270.c,v 1.5 1996/02/28 21:04:18 thorpej Exp $ */
/*
@@ -389,12 +389,12 @@ settranscom(argc, argv)
if (argc == 1) {
return 1;
}
- transcom = tline;
- (void) strcpy(transcom, argv[1]);
+ strlcpy(tline, argv[1], sizeof(tline));
for (i = 2; i < argc; ++i) {
- (void) strcat(transcom, " ");
- (void) strcat(transcom, argv[i]);
+ strlcat(tline, " ", sizeof(tline));
+ strlcat(tline, argv[i], sizeof(tline));
}
+ transcom = tline;
return 1;
}
#endif /* defined(unix) */
diff --git a/usr.bin/telnet/utilities.c b/usr.bin/telnet/utilities.c
index 8198b4fe20f..ee8ff1bbd3e 100644
--- a/usr.bin/telnet/utilities.c
+++ b/usr.bin/telnet/utilities.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utilities.c,v 1.7 2002/02/01 06:59:17 itojun Exp $ */
+/* $OpenBSD: utilities.c,v 1.8 2003/04/03 12:05:58 hin Exp $ */
/* $NetBSD: utilities.c,v 1.5 1996/02/28 21:04:21 thorpej Exp $ */
/*
@@ -107,7 +107,7 @@ SetNetTrace(file)
fprintf(stderr, "Cannot open %s.\n", file);
}
NetTrace = stdout;
- strcpy((char *)NetTraceFile, "(standard output)");
+ strlcpy((char *)NetTraceFile, "(standard output)", sizeof(NetTraceFile));
}
void