aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>1998-01-22 00:04:57 +0000
committerWarner Losh <imp@FreeBSD.org>1998-01-22 00:04:57 +0000
commitd82dcd5eafcbff4b323029fff3ee14179430f8d6 (patch)
tree82c2d1b026bf7af23a675523d95546bb475117ce /crypto
parent9f6c32362c3a88145171bf9a3d9deec57b76167e (diff)
downloadsrc-d82dcd5eafcbff4b323029fff3ee14179430f8d6.tar.gz
src-d82dcd5eafcbff4b323029fff3ee14179430f8d6.zip
MFC: sprintf paranoia
Notes
Notes: svn path=/head/; revision=32688
Diffstat (limited to 'crypto')
-rw-r--r--crypto/telnet/telnetd/sys_term.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/crypto/telnet/telnetd/sys_term.c b/crypto/telnet/telnetd/sys_term.c
index 1e5b9d0d36c5..591c9630053c 100644
--- a/crypto/telnet/telnetd/sys_term.c
+++ b/crypto/telnet/telnetd/sys_term.c
@@ -36,7 +36,7 @@
static const char sccsid[] = "@(#)sys_term.c 8.4+1 (Berkeley) 5/30/95";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: sys_term.c,v 1.3 1997/12/08 07:41:12 charnier Exp $";
#endif /* not lint */
#include "telnetd.h"
@@ -518,11 +518,11 @@ int *ptynum;
#endif
#ifndef __hpux
- (void) sprintf(line, "/dev/ptyXX");
+ (void) strcpy(line, "/dev/ptyXX");
p1 = &line[8];
p2 = &line[9];
#else
- (void) sprintf(line, "/dev/ptym/ptyXX");
+ (void) strcpy(line, "/dev/ptym/ptyXX");
p1 = &line[13];
p2 = &line[14];
#endif
@@ -1484,7 +1484,7 @@ startslave(host, autologin, autoname)
*/
if ((i = open(INIT_FIFO, O_WRONLY)) < 0) {
char tbuf[128];
- (void) sprintf(tbuf, "Can't open %s\n", INIT_FIFO);
+ (void) snprintf(tbuf, sizeof(tbuf), "Can't open %s\n", INIT_FIFO);
fatalperror(net, tbuf);
}
memset((char *)&request, 0, sizeof(request));
@@ -1507,7 +1507,7 @@ startslave(host, autologin, autoname)
#endif /* BFTPDAEMON */
if (write(i, (char *)&request, sizeof(request)) < 0) {
char tbuf[128];
- (void) sprintf(tbuf, "Can't write to %s\n", INIT_FIFO);
+ (void) snprintf(tbuf, sizeof(tbuf), "Can't write to %s\n", INIT_FIFO);
fatalperror(net, tbuf);
}
(void) close(i);
@@ -1519,7 +1519,7 @@ startslave(host, autologin, autoname)
if (i == 3 || n >= 0 || !gotalarm)
break;
gotalarm = 0;
- sprintf(tbuf, "telnetd: waiting for /etc/init to start login process on %s\r\n", line);
+ snprintf(tbuf, sizeof(tbuf), "telnetd: waiting for /etc/init to start login process on %s\r\n", line);
(void) write(net, tbuf, strlen(tbuf));
}
if (n < 0 && gotalarm)
@@ -1727,7 +1727,8 @@ start_login(host, autologin, name)
len = strlen(name)+1;
write(xpty, name, len);
write(xpty, name, len);
- sprintf(speed, "%s/%d", (cp = getenv("TERM")) ? cp : "",
+ snprintf(speed, sizeof(speed),
+ "%s/%d", (cp = getenv("TERM")) ? cp : "",
(def_rspeed > 0) ? def_rspeed : 9600);
len = strlen(speed)+1;
write(xpty, speed, len);