From bf393959c2b460929c0bb7624f49c5eb2a871acb Mon Sep 17 00:00:00 2001 From: pst Date: Mon, 15 Jul 1996 16:29:03 +0000 Subject: Do a bounds check on the strcpy of environment variables onto the stack. --- usr.bin/rlogin/rlogin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.bin') diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c index 4110c6f..254c05f 100644 --- a/usr.bin/rlogin/rlogin.c +++ b/usr.bin/rlogin/rlogin.c @@ -259,7 +259,7 @@ main(argc, argv) exit(1); } - (void)strcpy(term, (p = getenv("TERM")) ? p : "network"); + (void)strncpy(term, (p = getenv("TERM")) ? p : "network", sizeof(term)); if (ioctl(0, TIOCGETP, &ttyb) == 0) { (void)strcat(term, "/"); (void)strcat(term, speeds[(int)ttyb.sg_ospeed]); -- cgit v1.1