summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rmt
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1997-02-09 05:09:05 +0000
committerimp <imp@FreeBSD.org>1997-02-09 05:09:05 +0000
commit7f59fa4a4d1ff4191f2683d08b7e532bdba3a2fb (patch)
tree72bb0247efa13324cd3046ae97293d84fec8b79e /usr.sbin/rmt
parent0bd4c187acf470a3fb00c2633c8b9e4f3d46cfaf (diff)
downloadFreeBSD-src-7f59fa4a4d1ff4191f2683d08b7e532bdba3a2fb.zip
FreeBSD-src-7f59fa4a4d1ff4191f2683d08b7e532bdba3a2fb.tar.gz
Buffer overflow from OpenBSD:
Rev 1.3 millert: Fix potential buf oflow wrt strerror and sprintf. Obtained from: OpenBSD
Diffstat (limited to 'usr.sbin/rmt')
-rw-r--r--usr.sbin/rmt/rmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/rmt/rmt.c b/usr.sbin/rmt/rmt.c
index 79b4bbc..9a60527 100644
--- a/usr.sbin/rmt/rmt.c
+++ b/usr.sbin/rmt/rmt.c
@@ -244,6 +244,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));
}
OpenPOWER on IntegriCloud