From 262997012c30b3f954f9152d3de0bd86c7b2cb05 Mon Sep 17 00:00:00 2001 From: cperciva Date: Tue, 21 Apr 2009 10:54:47 +0000 Subject: [PATCH] MFH r191302: Fix a buffer overflow. For reasons of stack alignment, it does not appear that this is exploitable on any systems FreeBSD runs on, so this will not be getting a security advisory. Approved by: re (kib) git-svn-id: svn://svn.freebsd.org/base/releng/7.2@191353 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- contrib/ntp/ntpq/ntpq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/ntp/ntpq/ntpq.c b/contrib/ntp/ntpq/ntpq.c index 91379408..4835d7e3 100644 --- a/contrib/ntp/ntpq/ntpq.c +++ b/contrib/ntp/ntpq/ntpq.c @@ -3185,9 +3185,9 @@ cookedprint( if (!decodeuint(value, &uval)) output_raw = '?'; else { - char b[10]; + char b[12]; - (void) sprintf(b, "%03lo", uval); + (void) snprintf(b, sizeof(b), "%03lo", uval); output(fp, name, b); } break; -- 2.42.0