summaryrefslogtreecommitdiff
path: root/print-telnet.c
diff options
context:
space:
mode:
authoritojun <itojun>2000-01-17 06:24:23 +0000
committeritojun <itojun>2000-01-17 06:24:23 +0000
commitdff10c7f70d539c431a1eba9ab5e076d8b0f5c8e (patch)
tree29fbd05a7fa3afbeba9b422f86f9995c166d2eaa /print-telnet.c
parent92d3fd1b47a8c041297a3dfa655f0d548012f61c (diff)
downloadtcpdump-dff10c7f70d539c431a1eba9ab5e076d8b0f5c8e.tar.gz
s/sprintf/snprintf/.
there seem to be couple of unsafe use of strcat and strcpy - we should bring in strl{cat,cpy}.
Diffstat (limited to 'print-telnet.c')
-rw-r--r--print-telnet.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/print-telnet.c b/print-telnet.c
index beb6be91..cdce8398 100644
--- a/print-telnet.c
+++ b/print-telnet.c
@@ -51,7 +51,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.5 2000-01-09 21:34:20 fenner Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.6 2000-01-17 06:24:26 itojun Exp $";
#endif
#include <sys/param.h>
@@ -127,15 +127,16 @@ telnet_print(register const u_char *sp, u_int length)
x = *sp++; /* option */
length--;
if (x >= 0 && x < NTELOPTS) {
- (void)sprintf(tnet, "%s %s",
- telcmds[i], telopts[x]);
+ (void)snprintf(tnet, sizeof(tnet),
+ "%s %s", telcmds[i], telopts[x]);
} else {
- (void)sprintf(tnet, "%s %#x",
- telcmds[i], x);
+ (void)snprintf(tnet, sizeof(tnet),
+ "%s %#x", telcmds[i], x);
}
break;
default:
- (void)strcpy(tnet, telcmds[i]);
+ (void)snprintf(tnet, sizeof(tnet), "%s",
+ telcmds[i]);
}
if (c == SB) {
c = *sp++;