summaryrefslogtreecommitdiff
path: root/libexec/talkd/announce.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-17 23:17:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-17 23:17:09 +0000
commitcabb04b1427b552b960fbaaa18ca3b4b30d6d810 (patch)
tree309b48147b34b142ba7de5121d93b048b578c22a /libexec/talkd/announce.c
parentae0c1d0a3e2fa07623de6a4e8da00b890db9c893 (diff)
buffer overflow
Diffstat (limited to 'libexec/talkd/announce.c')
-rw-r--r--libexec/talkd/announce.c9
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)