diff options
author | 1996-07-17 23:17:08 +0000 | |
---|---|---|
committer | 1996-07-17 23:17:08 +0000 | |
commit | 99ee09203247ef1b9931df9fa9d047edcb9a1fab (patch) | |
tree | 83d964f4c6a655f4703d4ad457419f1cdcc6e356 | |
parent | nextbsd pr#2637 (and 2638): add cirrus gd5434. (diff) | |
download | wireguard-openbsd-99ee09203247ef1b9931df9fa9d047edcb9a1fab.tar.xz wireguard-openbsd-99ee09203247ef1b9931df9fa9d047edcb9a1fab.zip |
buffer overflow
-rw-r--r-- | libexec/talkd/announce.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libexec/talkd/announce.c b/libexec/talkd/announce.c index e267c326346..e6c0572cb21 100644 --- a/libexec/talkd/announce.c +++ b/libexec/talkd/announce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: announce.c,v 1.2 1996/04/28 23:56:18 mickey Exp $ */ +/* $OpenBSD: announce.c,v 1.3 1996/07/17 23:17:08 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -35,7 +35,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)announce.c 5.9 (Berkeley) 2/26/91";*/ -static char rcsid[] = "$Id: announce.c,v 1.2 1996/04/28 23:56:18 mickey Exp $"; +static char rcsid[] = "$Id: announce.c,v 1.3 1996/07/17 23:17:08 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -104,11 +104,12 @@ announce_proc(request, remote_machine) char *remote_machine; { int pid, status; - char full_tty[32]; + char full_tty[MAXPATHLEN]; FILE *tf; struct stat stbuf; - (void)sprintf(full_tty, "%s/%s", _PATH_DEV, request->r_tty); + (void)snprintf(full_tty, sizeof full_tty, "%s/%s", _PATH_DEV, + request->r_tty); if (access(full_tty, 0) != 0) return (FAILED); if ((tf = fopen(full_tty, "w")) == NULL) |