diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-24 22:04:03 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-24 22:04:03 +0000 |
commit | abefad5cd129154eae7163795db46a429e043990 (patch) | |
tree | 2ba6b48d1321a96c5d4502c42d6dfd719603d9e5 | |
parent | 1fb300270aa1c19a363a335b4e50afb8410a545a (diff) |
strlcpy at most 16 characters, so says man page
-rw-r--r-- | lib/libutil/pty.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c index 6d4fd8b8d20..c2493f2a53b 100644 --- a/lib/libutil/pty.c +++ b/lib/libutil/pty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pty.c,v 1.7 2002/05/24 21:24:15 deraadt Exp $ */ +/* $OpenBSD: pty.c,v 1.8 2002/05/24 22:04:02 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -34,7 +34,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /* from: static char sccsid[] = "@(#)pty.c 8.1 (Berkeley) 6/4/93"; */ -static char *rcsid = "$Id: pty.c,v 1.7 2002/05/24 21:24:15 deraadt Exp $"; +static char *rcsid = "$Id: pty.c,v 1.8 2002/05/24 22:04:02 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/cdefs.h> @@ -86,8 +86,13 @@ openpty(amaster, aslave, name, termp, winp) if ((slave = open(line, O_RDWR, 0)) != -1) { *amaster = master; *aslave = slave; - if (name) - strcpy(name, line); + if (name) { + /* + * Manual page says "at least + * 16 characters". + */ + strlcpy(name, line, 16); + } if (termp) (void) tcsetattr(slave, TCSAFLUSH, termp); |