From owner-svn-src-vendor@FreeBSD.ORG Sun Apr 19 23:34:52 2009 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A377106568A; Sun, 19 Apr 2009 23:34:52 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77A038FC23; Sun, 19 Apr 2009 23:34:52 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3JNYq3g024274; Sun, 19 Apr 2009 23:34:52 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3JNYq4F024273; Sun, 19 Apr 2009 23:34:52 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <200904192334.n3JNYq4F024273@svn.freebsd.org> From: Ollivier Robert Date: Sun, 19 Apr 2009 23:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191298 - vendor/ntp/dist/ntpq X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Apr 2009 23:34:53 -0000 Author: roberto Date: Sun Apr 19 23:34:52 2009 New Revision: 191298 URL: http://svn.freebsd.org/changeset/base/191298 Log: Prevent a buffer overflow in ntpq. Patch taken from the PR database after being committed to the official ntp tree and present in 4.2.4p7-rc2. It will be MFH to the upcoming 7.2 pending re approval. Obtained from: https://support.ntp.org/bugs/show_bug.cgi?id=1144 MFC after: 3 days Security: http://www.securityfocus.com/bid/34481 CVE-2009-0159 Modified: vendor/ntp/dist/ntpq/ntpq.c Modified: vendor/ntp/dist/ntpq/ntpq.c ============================================================================== --- vendor/ntp/dist/ntpq/ntpq.c Sun Apr 19 23:34:22 2009 (r191297) +++ vendor/ntp/dist/ntpq/ntpq.c Sun Apr 19 23:34:52 2009 (r191298) @@ -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;