summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2018-12-29 21:21:07 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2018-12-29 23:02:01 +0100
commit10ca5198d87e67194880e4421dc4a3d348211008 (patch)
tree8cd4bfe569aeb70eda73c2e7c516e0d1a7935de6 /media-libs/libextractor
parentapp-emulation/wine-any: Sync with ::wine (diff)
downloadgentoo-10ca5198d87e67194880e4421dc4a3d348211008.tar.gz
gentoo-10ca5198d87e67194880e4421dc4a3d348211008.tar.bz2
gentoo-10ca5198d87e67194880e4421dc4a3d348211008.zip
media-libs/libextractor: Fix CVE-2018-20430, CVE-2018-20431
Bug: https://bugs.gentoo.org/673742 Package-Manager: Portage-2.3.52, Repoman-2.3.12 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'media-libs/libextractor')
-rw-r--r--media-libs/libextractor/files/libextractor-1.8-CVE-2018-20430.patch49
-rw-r--r--media-libs/libextractor/files/libextractor-1.8-CVE-2018-20431.patch39
-rw-r--r--media-libs/libextractor/libextractor-1.8-r1.ebuild117
3 files changed, 205 insertions, 0 deletions
diff --git a/media-libs/libextractor/files/libextractor-1.8-CVE-2018-20430.patch b/media-libs/libextractor/files/libextractor-1.8-CVE-2018-20430.patch
new file mode 100644
index 000000000000..d0b5968606ba
--- /dev/null
+++ b/media-libs/libextractor/files/libextractor-1.8-CVE-2018-20430.patch
@@ -0,0 +1,49 @@
+From b405d707b36e0654900cba78e89f49779efea110 Mon Sep 17 00:00:00 2001
+From: Christian Grothoff <christian@grothoff.org>
+Date: Thu, 20 Dec 2018 22:47:53 +0100
+Subject: fix #5493 (out of bounds read)
+
+---
+ src/common/convert.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/common/convert.c b/src/common/convert.c
+index c0edf21..2be2108 100644
+--- a/src/common/convert.c
++++ b/src/common/convert.c
+@@ -36,8 +36,8 @@
+ * string is returned.
+ */
+ char *
+-EXTRACTOR_common_convert_to_utf8 (const char *input,
+- size_t len,
++EXTRACTOR_common_convert_to_utf8 (const char *input,
++ size_t len,
+ const char *charset)
+ {
+ #if HAVE_ICONV
+@@ -52,7 +52,7 @@ EXTRACTOR_common_convert_to_utf8 (const char *input,
+ i = input;
+ cd = iconv_open ("UTF-8", charset);
+ if (cd == (iconv_t) - 1)
+- return strdup (i);
++ return strndup (i, len);
+ if (len > 1024 * 1024)
+ {
+ iconv_close (cd);
+@@ -67,11 +67,11 @@ EXTRACTOR_common_convert_to_utf8 (const char *input,
+ }
+ itmp = tmp;
+ finSize = tmpSize;
+- if (iconv (cd, (char **) &input, &len, &itmp, &finSize) == SIZE_MAX)
++ if (iconv (cd, (char **) &input, &len, &itmp, &finSize) == ((size_t) -1))
+ {
+ iconv_close (cd);
+ free (tmp);
+- return strdup (i);
++ return strndup (i, len);
+ }
+ ret = malloc (tmpSize - finSize + 1);
+ if (ret == NULL)
+--
+cgit v1.1
diff --git a/media-libs/libextractor/files/libextractor-1.8-CVE-2018-20431.patch b/media-libs/libextractor/files/libextractor-1.8-CVE-2018-20431.patch
new file mode 100644
index 000000000000..2cd0448ba894
--- /dev/null
+++ b/media-libs/libextractor/files/libextractor-1.8-CVE-2018-20431.patch
@@ -0,0 +1,39 @@
+From 489c4a540bb2c4744471441425b8932b97a153e7 Mon Sep 17 00:00:00 2001
+From: Christian Grothoff <christian@grothoff.org>
+Date: Thu, 20 Dec 2018 23:02:28 +0100
+Subject: fix #5494
+
+---
+ ChangeLog | 3 ++-
+ src/plugins/ole2_extractor.c | 9 +++++++--
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/src/plugins/ole2_extractor.c b/src/plugins/ole2_extractor.c
+index 53fa1b9..a48b726 100644
+--- a/src/plugins/ole2_extractor.c
++++ b/src/plugins/ole2_extractor.c
+@@ -173,7 +173,7 @@ struct ProcContext
+ EXTRACTOR_MetaDataProcessor proc;
+
+ /**
+- * Closure for 'proc'.
++ * Closure for @e proc.
+ */
+ void *proc_cls;
+
+@@ -213,7 +213,12 @@ process_metadata (gpointer key,
+
+ if (G_VALUE_TYPE(gval) == G_TYPE_STRING)
+ {
+- contents = strdup (g_value_get_string (gval));
++ const char *gvals;
++
++ gvals = g_value_get_string (gval);
++ if (NULL == gvals)
++ return;
++ contents = strdup (gvals);
+ }
+ else
+ {
+--
+cgit v1.1
diff --git a/media-libs/libextractor/libextractor-1.8-r1.ebuild b/media-libs/libextractor/libextractor-1.8-r1.ebuild
new file mode 100644
index 000000000000..451712307910
--- /dev/null
+++ b/media-libs/libextractor/libextractor-1.8-r1.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="Library to extract metadata from files of arbitrary type"
+HOMEPAGE="https://www.gnu.org/software/libextractor/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
+IUSE="apparmor +archive +bzip2 ffmpeg flac gif gsf gstreamer gtk jpeg +magic midi mp4 mpeg tidy tiff vorbis +zlib" # test
+
+RESTRICT="test"
+
+DEPEND="
+ app-text/iso-codes
+ dev-libs/glib:2
+ <media-gfx/exiv2-0.27:=
+ sys-devel/libtool
+ virtual/libiconv
+ virtual/libintl
+ apparmor? ( sys-libs/libapparmor )
+ archive? ( app-arch/libarchive:= )
+ bzip2? ( app-arch/bzip2 )
+ ffmpeg? ( virtual/ffmpeg )
+ flac? (
+ media-libs/flac
+ media-libs/libogg
+ )
+ gif? ( media-libs/giflib:= )
+ gsf? ( gnome-extra/libgsf:= )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ )
+ gtk? ( x11-libs/gtk+:3 )
+ jpeg? ( virtual/jpeg:0 )
+ magic? ( sys-apps/file )
+ midi? ( media-libs/libsmf )
+ mp4? ( media-libs/libmp4v2:0 )
+ mpeg? ( media-libs/libmpeg2 )
+ tidy? ( app-text/tidy-html5 )
+ tiff? ( media-libs/tiff:0 )
+ vorbis? (
+ media-libs/libogg
+ media-libs/libvorbis
+ )
+ zlib? ( sys-libs/zlib )
+"
+BDEPEND="
+ sys-devel/gettext
+ virtual/pkgconfig
+"
+# test? ( app-forensics/zzuf )
+RDEPEND="${DEPEND}
+ !sci-biology/glimmer
+"
+
+PATCHES=( "${FILESDIR}"/${P}-CVE-2018-2043{0,1}.patch )
+
+src_prepare() {
+ default
+
+ # m4/ax_create_pkgconfig_info.m4 is passing environment LDFLAGS to Libs:
+ sed -i \
+ -e '/^ax_create_pkgconfig_ldflags=/s:$LDFLAGS ::' \
+ -e 's:tidy/tidy.h:tidy.h:' \
+ -e 's:tidy/tidybuffio.h:buffio.h:' \
+ configure src/plugins/html_extractor.c || die
+
+ if ! use tidy; then
+ sed -i -e 's:tidy.h:dIsAbLe&:' configure || die
+ fi
+}
+
+src_configure() {
+ e_ac_cv() {
+ export ac_cv_"$@"
+ }
+
+ e_ac_cv {lib_rpm_rpmReadPackageFile,prog_HAVE_ZZUF}=no
+
+ e_ac_cv header_FLAC_all_h=$(usex flac)
+ e_ac_cv lib_FLAC_FLAC__stream_decoder_init_stream=$(usex flac)
+ e_ac_cv lib_FLAC_FLAC__stream_decoder_init_ogg_stream=$(usex flac)
+
+ e_ac_cv header_sys_apparmor_h=$(usex apparmor)
+ e_ac_cv header_archive_h=$(usex archive)
+ e_ac_cv header_bzlib_h=$(usex bzip2)
+ e_ac_cv header_gif_lib_h=$(usex gif)
+ e_ac_cv header_jpeglib_h=$(usex jpeg)
+ e_ac_cv header_magic_h=$(usex magic)
+ e_ac_cv header_mpeg2dec_mpeg2_h=$(usex mpeg)
+ e_ac_cv header_tiffio_h=$(usex tiff)
+ e_ac_cv header_vorbis_vorbisfile_h=$(usex vorbis)
+ e_ac_cv header_zlib_h=$(usex zlib)
+ e_ac_cv lib_mp4v2_MP4ReadProvider=$(usex mp4)
+ e_ac_cv lib_smf_smf_load_from_memory=$(usex midi)
+
+ local myeconfargs=(
+ --disable-static
+ --enable-experimental
+ --enable-glib
+ --disable-gsf-gnome
+ $(use_enable ffmpeg)
+ $(use_enable gsf)
+ $(use_with gstreamer)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+ find "${ED}" -name '*.la' -delete || die
+}