flac: Fix CVE-2017-6888 6827/head
authorRosen Penev <rosenp@gmail.com>
Tue, 21 Aug 2018 04:12:50 +0000 (21:12 -0700)
committerRosen Penev <rosenp@gmail.com>
Tue, 21 Aug 2018 04:38:07 +0000 (21:38 -0700)
Added PKG_CPE_ID for proper CVE tracking.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/flac/Makefile
libs/flac/patches/100-CVE-2017-6888.patch [new file with mode: 0644]

index 28e9a46218077ff64cd6830630a9f14b1294fe54..47de71e32d9158e2169d77a535d0e23389363efa 100644 (file)
@@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=flac
 PKG_VERSION:=1.3.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://downloads.xiph.org/releases/flac/
+PKG_SOURCE_URL:=https://downloads.xiph.org/releases/flac/
 PKG_HASH:=91cfc3ed61dc40f47f050a109b08610667d73477af6ef36dcad31c31a4a8d53f
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
@@ -20,6 +20,7 @@ PKG_INSTALL:=1
 
 PKG_LICENSE:=GFDL-1.2 GPL-2 LGPL-2.1 BSD-3-Clause
 PKG_LICENSE_FILES:=README COPYING.FDL COPYING.GPL COPYING.LGPL COPYING.Xiph
+PKG_CPE_ID:=cpe:/a:flac_project:flac
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=autogen.sh aclocal.m4
diff --git a/libs/flac/patches/100-CVE-2017-6888.patch b/libs/flac/patches/100-CVE-2017-6888.patch
new file mode 100644 (file)
index 0000000..3de0cc5
--- /dev/null
@@ -0,0 +1,27 @@
+From 4f47b63e9c971e6391590caf00a0f2a5ed612e67 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd@mega-nerd.com>
+Date: Sat, 8 Apr 2017 18:34:49 +1000
+Subject: [PATCH] stream_decoder.c: Fix a memory leak
+
+Leak reported by Secunia Research.
+---
+ src/libFLAC/stream_decoder.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
+index 14d5fe7f..a5527511 100644
+--- a/src/libFLAC/stream_decoder.c
++++ b/src/libFLAC/stream_decoder.c
+@@ -1759,6 +1759,9 @@ FLAC__bool read_metadata_vorbiscomment_(FLAC__StreamDecoder *decoder, FLAC__Stre
+                                       }
+                                       memset (obj->comments[i].entry, 0, obj->comments[i].length) ;
+                                       if (!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->comments[i].entry, obj->comments[i].length)) {
++                                              /* Current i-th entry is bad, so we delete it. */
++                                              free (obj->comments[i].entry) ;
++                                              obj->comments[i].entry = NULL ;
+                                               obj->num_comments = i;
+                                               goto skip;
+                                       }
+-- 
+2.17.0
+