summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Maier <tamiko@gentoo.org>2014-10-23 19:30:39 +0000
committerMatthias Maier <tamiko@gentoo.org>2014-10-23 19:30:39 +0000
commitece4dca266172480295236caabfec009109ecc42 (patch)
tree3703f39820206956c0d009c9b51ba0c698eb2b1c /media-libs/lcms
parentarm stable, bug #524820 (diff)
downloadgentoo-2-ece4dca266172480295236caabfec009109ecc42.tar.gz
gentoo-2-ece4dca266172480295236caabfec009109ecc42.tar.bz2
gentoo-2-ece4dca266172480295236caabfec009109ecc42.zip
fix CVE-2013-4276 wrt bug #479874
(Portage version: 2.2.8-r2/cvs/Linux x86_64, signed Manifest commit with key BD3A97A3)
Diffstat (limited to 'media-libs/lcms')
-rw-r--r--media-libs/lcms/ChangeLog8
-rw-r--r--media-libs/lcms/files/lcms-1.19-cve-2013-4276.patch69
-rw-r--r--media-libs/lcms/lcms-1.19-r3.ebuild111
3 files changed, 187 insertions, 1 deletions
diff --git a/media-libs/lcms/ChangeLog b/media-libs/lcms/ChangeLog
index c4594b6d93fd..410224e9c639 100644
--- a/media-libs/lcms/ChangeLog
+++ b/media-libs/lcms/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for media-libs/lcms
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/lcms/ChangeLog,v 1.178 2014/07/04 19:39:06 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/lcms/ChangeLog,v 1.179 2014/10/23 19:30:38 tamiko Exp $
+
+*lcms-1.19-r3 (23 Oct 2014)
+
+ 23 Oct 2014; Matthias Maier <tamiko@gentoo.org>
+ +files/lcms-1.19-cve-2013-4276.patch, +lcms-1.19-r3.ebuild:
+ fix CVE-2013-4276 wrt bug #479874
04 Jul 2014; Agostino Sarubbo <ago@gentoo.org> lcms-1.19-r1.ebuild:
Stable for ppc, wrt bug #504214
diff --git a/media-libs/lcms/files/lcms-1.19-cve-2013-4276.patch b/media-libs/lcms/files/lcms-1.19-cve-2013-4276.patch
new file mode 100644
index 000000000000..87c96605d6b0
--- /dev/null
+++ b/media-libs/lcms/files/lcms-1.19-cve-2013-4276.patch
@@ -0,0 +1,69 @@
+patch taken from:
+ https://bugzilla.redhat.com/show_bug.cgi?id=991757
+
+patch checked against:
+ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718682#10
+ https://build.opensuse.org/package/view_file/openSUSE:Evergreen:11.2:Test/lcms/CVE-2013-4276.patch
+
+diff -ur lcms-1.19.dfsg/samples/icctrans.c lcms-1.19.dfsg-patched/samples/icctrans.c
+--- lcms-1.19.dfsg/samples/icctrans.c 2009-10-30 15:57:45.000000000 +0000
++++ lcms-1.19.dfsg-patched/samples/icctrans.c 2013-08-06 11:53:14.385266647 +0100
+@@ -86,6 +86,8 @@
+ static LPcmsNAMEDCOLORLIST InputColorant = NULL;
+ static LPcmsNAMEDCOLORLIST OutputColorant = NULL;
+
++unsigned int Buffer_size = 4096;
++
+
+ // isatty replacement
+
+@@ -500,7 +502,7 @@
+
+ Prefix[0] = 0;
+ if (!lTerse)
+- sprintf(Prefix, "%s=", C);
++ snprintf(Prefix, 20, "%s=", C);
+
+ if (InHexa)
+ {
+@@ -648,7 +650,9 @@
+ static
+ void GetLine(char* Buffer)
+ {
+- scanf("%s", Buffer);
++ char User_buffer[Buffer_size];
++ fgets(User_buffer, (Buffer_size - 1), stdin);
++ sscanf(User_buffer,"%s", Buffer);
+
+ if (toupper(Buffer[0]) == 'Q') { // Quit?
+
+@@ -668,7 +672,7 @@
+ static
+ double GetAnswer(const char* Prompt, double Range)
+ {
+- char Buffer[4096];
++ char Buffer[Buffer_size];
+ double val = 0.0;
+
+ if (Range == 0.0) { // Range 0 means double value
+@@ -738,7 +742,7 @@
+ static
+ WORD GetIndex(void)
+ {
+- char Buffer[4096], Name[40], Prefix[40], Suffix[40];
++ char Buffer[Buffer_size], Name[40], Prefix[40], Suffix[40];
+ int index, max;
+
+ max = cmsNamedColorCount(hTrans)-1;
+diff -ur lcms-1.19.dfsg/tifficc/tiffdiff.c lcms-1.19.dfsg-patched/tifficc/tiffdiff.c
+--- lcms-1.19.dfsg/tifficc/tiffdiff.c 2009-10-30 15:57:46.000000000 +0000
++++ lcms-1.19.dfsg-patched/tifficc/tiffdiff.c 2013-08-06 11:49:06.698951157 +0100
+@@ -633,7 +633,7 @@
+ cmsIT8SetSheetType(hIT8, "TIFFDIFF");
+
+
+- sprintf(Buffer, "Differences between %s and %s", TiffName1, TiffName2);
++ snprintf(Buffer, 256, "Differences between %s and %s", TiffName1, TiffName2);
+
+ cmsIT8SetComment(hIT8, Buffer);
+
diff --git a/media-libs/lcms/lcms-1.19-r3.ebuild b/media-libs/lcms/lcms-1.19-r3.ebuild
new file mode 100644
index 000000000000..48cf6e8cf939
--- /dev/null
+++ b/media-libs/lcms/lcms-1.19-r3.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/lcms/lcms-1.19-r3.ebuild,v 1.1 2014/10/23 19:30:38 tamiko Exp $
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3,3_4} )
+
+# autoreconf needs to update python macros for py3 support.
+AUTOTOOLS_AUTORECONF=1
+
+inherit autotools-multilib python-r1
+
+DESCRIPTION="A lightweight, speed optimized color management engine"
+HOMEPAGE="http://www.littlecms.com/"
+SRC_URI="http://www.littlecms.com/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="jpeg python static-libs tiff zlib"
+
+RDEPEND="
+ tiff? ( >=media-libs/tiff-4.0.3-r6:0[${MULTILIB_USEDEP}] )
+ jpeg? ( >=virtual/jpeg-0-r2:0[${MULTILIB_USEDEP}] )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
+ python? ( ${PYTHON_DEPS} )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r11
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )
+"
+DEPEND="${RDEPEND}
+ python? ( >=dev-lang/swig-1.3.31 )
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-disable_static_modules.patch"
+ "${FILESDIR}/${P}-implicit.patch"
+ "${FILESDIR}/${P}-fix-swig-destructor.patch"
+ "${FILESDIR}/${P}-fix-python3.2.patch"
+ "${FILESDIR}/${P}-cve-2013-4276.patch"
+)
+
+src_prepare() {
+ # Breaks out-of-source build, only corresponding .in file is needed
+ rm include/icc34.h || die 'rm failed'
+
+ autotools-utils_src_prepare
+
+ # run swig to regenerate lcms_wrap.cxx and lcms.py (bug #148728)
+ if use python; then
+ cd python || die
+ bash swig_lcms || die
+ fi
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_with jpeg)
+ $(use_with tiff)
+ $(use_with zlib)
+ )
+ autotools-utils_src_configure --without-python
+
+ if multilib_is_native_abi && use python; then
+ python_parallel_foreach_impl \
+ autotools-utils_src_configure --with-python
+ fi
+}
+
+multilib_src_compile() {
+ default
+
+ if multilib_is_native_abi && use python; then
+ # Note: it intentionally passes evaluated 'parent' dir.
+ python_parallel_foreach_impl \
+ autotools-utils_src_compile -C python \
+ top_builddir="${BUILD_DIR}"
+ fi
+}
+
+multilib_src_test() {
+ cp "${S}"/testbed/*icm testbed/ || die
+
+ default
+}
+
+multilib_src_install() {
+ emake DESTDIR="${ED}" BINDIR="${ED}"/usr/bin install
+
+ if multilib_is_native_abi && use python; then
+ # Note: it intentionally passes evaluated 'parent' dir.
+ python_foreach_impl \
+ autotools-utils_src_install -C python \
+ top_builddir="${BUILD_DIR}"
+
+ python_parallel_foreach_impl python_optimize
+ fi
+
+ insinto /usr/share/lcms/profiles
+ doins "${S}"/testbed/*.icm
+}
+
+multilib_src_install_all() {
+ DOCS=( AUTHORS README.1ST INSTALL NEWS doc/{LCMSAPI,TUTORIAL}.TXT )
+
+ einstalldocs
+ prune_libtool_files --modules
+}