From 3f33d8cd97e5b9fc0dbcab2a1879842de9f0b6d0 Mon Sep 17 00:00:00 2001 From: millert Date: Sun, 15 Sep 1996 21:56:11 +0000 Subject: [PATCH] sprintf -> snprintf paranoia --- bin/chio/chio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/chio/chio.c b/bin/chio/chio.c index a808f9a7a14..c5734570c23 100644 --- a/bin/chio/chio.c +++ b/bin/chio/chio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chio.c,v 1.2 1996/06/23 14:19:04 deraadt Exp $ */ +/* $OpenBSD: chio.c,v 1.3 1996/09/15 21:56:11 millert Exp $ */ /* $NetBSD: chio.c,v 1.1.1.1 1996/04/03 00:34:38 thorpej Exp $ */ /* @@ -638,7 +638,8 @@ bits_to_string(v, cp) np++; if ((v & (1 << (f - 1))) == 0) continue; - bp += sprintf(bp, "%c%.*s", sep, np - cp, cp); + bp += snprintf(bp, sizeof(buf) - (bp - &buf[0]), + "%c%.*s", sep, np - cp, cp); sep = ','; } if (sep != '<') -- 2.20.1