Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Apr 2009 10:49:40 +0000 (UTC)
From:      Colin Percival <cperciva@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r191351 - in stable/7/contrib/ntp: . ntpq
Message-ID:  <200904211049.n3LAneMq080296@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cperciva
Date: Tue Apr 21 10:49:40 2009
New Revision: 191351
URL: http://svn.freebsd.org/changeset/base/191351

Log:
  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)

Modified:
  stable/7/contrib/ntp/   (props changed)
  stable/7/contrib/ntp/ntpq/ntpq.c

Modified: stable/7/contrib/ntp/ntpq/ntpq.c
==============================================================================
--- stable/7/contrib/ntp/ntpq/ntpq.c	Tue Apr 21 09:55:17 2009	(r191350)
+++ stable/7/contrib/ntp/ntpq/ntpq.c	Tue Apr 21 10:49:40 2009	(r191351)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904211049.n3LAneMq080296>