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]);