From 9a05362f7a0962bf26b6969356ced86c459f23b7 Mon Sep 17 00:00:00 2001 From: Nicolas Thill Date: Sat, 23 May 2009 02:36:44 +0000 Subject: [PATCH] [CVE-2009-0159] fix stack-based buffer overflow in ntpq SVN-Revision: 16007 --- net/ntpd/Makefile | 6 +++--- net/ntpd/patches/901-cve-2009-0159.patch | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 net/ntpd/patches/901-cve-2009-0159.patch diff --git a/net/ntpd/Makefile b/net/ntpd/Makefile index 81280db821..d8620a57c0 100644 --- a/net/ntpd/Makefile +++ b/net/ntpd/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2008 OpenWrt.org +# Copyright (C) 2006-2009 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -10,10 +10,10 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ntp PKG_VERSION:=4.2.4p6 -PKG_RELEASE:=2 +PKG_RELEASE:=2.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ +PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ PKG_MD5SUM:=1961c2c12b66b9046d5df37d0a41b181 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) diff --git a/net/ntpd/patches/901-cve-2009-0159.patch b/net/ntpd/patches/901-cve-2009-0159.patch new file mode 100644 index 0000000000..89b588f814 --- /dev/null +++ b/net/ntpd/patches/901-cve-2009-0159.patch @@ -0,0 +1,16 @@ +http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0159 + +--- a/ntpq/ntpq.c ++++ b/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.30.2