From: millert Date: Fri, 17 Jan 1997 15:46:55 +0000 (+0000) Subject: Fix potential buf oflow wrt strerror and sprintf. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=550179eec46c0a5f83370050233d650f4f419521;p=openbsd Fix potential buf oflow wrt strerror and sprintf. --- 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)); }