From e3ff6ee1850c6cf71f8f19bfd5501ac5d234e1ea Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 17 Jan 1997 15:46:56 +0000 Subject: Fix potential buf oflow wrt strerror and sprintf. --- usr.sbin/rmt/rmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.sbin/rmt/rmt.c') diff --git a/usr.sbin/rmt/rmt.c b/usr.sbin/rmt/rmt.c index a064ba14969..cb665ef802b 100644 --- a/usr.sbin/rmt/rmt.c +++ b/usr.sbin/rmt/rmt.c @@ -39,7 +39,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)rmt.c 5.6 (Berkeley) 6/1/90";*/ -static char rcsid[] = "$Id: rmt.c,v 1.2 1996/08/10 22:24:18 deraadt Exp $"; +static char rcsid[] = "$Id: rmt.c,v 1.3 1997/01/17 15:46:55 millert Exp $"; #endif /* not lint */ /* @@ -240,6 +240,6 @@ error(num) { DEBUG2("rmtd: E %d (%s)\n", num, strerror(num)); - (void) sprintf(resp, "E%d\n%s\n", num, strerror(num)); + (void) snprintf(resp, sizeof (resp), "E%d\n%s\n", num, strerror(num)); (void) write(1, resp, strlen(resp)); } -- cgit v1.2.3