From 550179eec46c0a5f83370050233d650f4f419521 Mon Sep 17 00:00:00 2001 From: millert Date: Fri, 17 Jan 1997 15:46:55 +0000 Subject: [PATCH] Fix potential buf oflow wrt strerror and sprintf. --- usr.sbin/rmt/rmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); } -- 2.20.1