From caef76e8bd5e03af7403f5cde36938edbdbf7867 Mon Sep 17 00:00:00 2001 From: Paul Traina Date: Mon, 15 Jul 1996 16:29:03 +0000 Subject: [PATCH] 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(-) diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c index 4110c6f889a6..254c05f5969d 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]);