From b2e335e1bbad3b238117b8d7481bb2f65fa8aebd Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 6 Feb 1997 12:49:56 +0000 Subject: [PATCH] buf oflow --- libexec/rexecd/rexecd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c index cebbe44d5ba..9df468ecca5 100644 --- a/libexec/rexecd/rexecd.c +++ b/libexec/rexecd/rexecd.c @@ -39,7 +39,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)rexecd.c 5.12 (Berkeley) 2/25/91";*/ -static char rcsid[] = "$Id: rexecd.c,v 1.6 1997/01/17 07:12:06 millert Exp $"; +static char rcsid[] = "$Id: rexecd.c,v 1.7 1997/02/06 12:49:56 deraadt Exp $"; #endif /* not lint */ #include @@ -258,7 +258,7 @@ error(fmt, a1, a2, a3) char buf[BUFSIZ]; buf[0] = 1; - (void) sprintf(buf+1, fmt, a1, a2, a3); + (void) snprintf(buf+1, sizeof buf-1, fmt, a1, a2, a3); (void) write(2, buf, strlen(buf)); } -- 2.20.1