aboutsummaryrefslogtreecommitdiffstats
path: root/main/openjpeg
diff options
context:
space:
mode:
authorDaniel Sabogal <dsabogalcc@gmail.com>2016-09-15 12:53:23 -0400
committerJakub Jirutka <jakub@jirutka.cz>2016-09-21 01:21:20 +0200
commitcc30e48f2395b7893ffd566af92c1354494a1060 (patch)
tree6d20d0ccf349c8325d6739ae0df07b26afbdb417 /main/openjpeg
parentf4a083bd7a02c3fce05d1732453469acdb1c0e62 (diff)
downloadaports-cc30e48f2395b7893ffd566af92c1354494a1060.tar.bz2
aports-cc30e48f2395b7893ffd566af92c1354494a1060.tar.xz
main/openjpeg: security fix (CVE-2016-7163)
Diffstat (limited to 'main/openjpeg')
-rw-r--r--main/openjpeg/APKBUILD23
-rw-r--r--main/openjpeg/CVE-2016-7163-1.patch33
-rw-r--r--main/openjpeg/CVE-2016-7163-2.patch26
3 files changed, 76 insertions, 6 deletions
diff --git a/main/openjpeg/APKBUILD b/main/openjpeg/APKBUILD
index 65453d4fe7..c3aaa511aa 100644
--- a/main/openjpeg/APKBUILD
+++ b/main/openjpeg/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=openjpeg
pkgver=2.1.1
-pkgrel=0
+pkgrel=1
pkgdesc="Open-source implementation of JPEG2000 image codec"
url="http://www.openjpeg.org/"
arch="all"
@@ -12,10 +12,15 @@ depends_dev=""
makedepends="$depends_dev libpng-dev tiff-dev lcms-dev doxygen cmake"
install=""
subpackages="$pkgname-dev $pkgname-tools"
-source="$pkgname-$pkgver.tar.gz::https://github.com/uclouvain/openjpeg/archive/v$pkgver.tar.gz"
-
+source="$pkgname-$pkgver.tar.gz::https://github.com/uclouvain/openjpeg/archive/v$pkgver.tar.gz
+ CVE-2016-7163-1.patch
+ CVE-2016-7163-2.patch"
builddir="${srcdir}/$pkgname-$pkgver"
+# secfixes:
+# 2.1.1-r1:
+# - CVE-2016-7163
+
build() {
cd "$builddir"
cmake . \
@@ -38,6 +43,12 @@ tools() {
mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}
-md5sums="0cc4b2aee0a9b6e9e21b7abcd201a3ec openjpeg-2.1.1.tar.gz"
-sha256sums="82c27f47fc7219e2ed5537ac69545bf15ed8c6ba8e6e1e529f89f7356506dbaa openjpeg-2.1.1.tar.gz"
-sha512sums="c7c5cd95a3b8bc643207fecdfbffd45c3d91e48196455ae42061862aebcd558c3e508c39513285b8ebb4f57b7316116d15cc74c0b9cc3e31c2a7b70d3e5e2cdd openjpeg-2.1.1.tar.gz"
+md5sums="0cc4b2aee0a9b6e9e21b7abcd201a3ec openjpeg-2.1.1.tar.gz
+0c0e55bc80b5cd6b163fbc041e4e7aae CVE-2016-7163-1.patch
+4edb6725ac44bd254f385a78ad4faa98 CVE-2016-7163-2.patch"
+sha256sums="82c27f47fc7219e2ed5537ac69545bf15ed8c6ba8e6e1e529f89f7356506dbaa openjpeg-2.1.1.tar.gz
+65137ddd802e36893a52362da56de1b75c15c338f22e1c378c21288529008189 CVE-2016-7163-1.patch
+a36c73da751049410e94a9f4e56bce572ef5005ec8637401da9c02be0253d0ce CVE-2016-7163-2.patch"
+sha512sums="c7c5cd95a3b8bc643207fecdfbffd45c3d91e48196455ae42061862aebcd558c3e508c39513285b8ebb4f57b7316116d15cc74c0b9cc3e31c2a7b70d3e5e2cdd openjpeg-2.1.1.tar.gz
+3ab55487147464caf428c28f2a8585983a3a203bba731d83411b0bb0bfb8765992874aa42de3fddd8be5245897224f292c9853dc6103c5e16a3aa5bc1737b5be CVE-2016-7163-1.patch
+d091d6ccbdbc7a2e2308815c5448f94a8d7f854c04c137d99f49bb26d142b790008388b730d9d83891842211ec56f1833a954e3bdfa3130ce7dcc1021a15c87e CVE-2016-7163-2.patch"
diff --git a/main/openjpeg/CVE-2016-7163-1.patch b/main/openjpeg/CVE-2016-7163-1.patch
new file mode 100644
index 0000000000..c7d277a562
--- /dev/null
+++ b/main/openjpeg/CVE-2016-7163-1.patch
@@ -0,0 +1,33 @@
+From c16bc057ba3f125051c9966cf1f5b68a05681de4 Mon Sep 17 00:00:00 2001
+From: trylab <trylab@users.noreply.github.com>
+Date: Tue, 6 Sep 2016 13:55:49 +0800
+Subject: [PATCH] Fix an integer overflow issue (#809)
+
+Prevent an integer overflow issue in function opj_pi_create_decode of
+pi.c.
+---
+ src/lib/openjp2/pi.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/lib/openjp2/pi.c b/src/lib/openjp2/pi.c
+index cffad66..36e2ff0 100644
+--- a/src/lib/openjp2/pi.c
++++ b/src/lib/openjp2/pi.c
+@@ -1237,7 +1237,13 @@ opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image,
+ l_current_pi = l_pi;
+
+ /* memory allocation for include */
+- l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16));
++ /* prevent an integer overflow issue */
++ l_current_pi->include = 00;
++ if (l_step_l <= (SIZE_MAX / (l_tcp->numlayers + 1U)))
++ {
++ l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16));
++ }
++
+ if
+ (!l_current_pi->include)
+ {
+--
+2.10.0
+
diff --git a/main/openjpeg/CVE-2016-7163-2.patch b/main/openjpeg/CVE-2016-7163-2.patch
new file mode 100644
index 0000000000..71af3d7561
--- /dev/null
+++ b/main/openjpeg/CVE-2016-7163-2.patch
@@ -0,0 +1,26 @@
+From ef01f18dfc6780b776d0674ed3e7415c6ef54d24 Mon Sep 17 00:00:00 2001
+From: Matthieu Darbois <mayeut@users.noreply.github.com>
+Date: Thu, 8 Sep 2016 07:34:46 +0200
+Subject: [PATCH] Cast to size_t before multiplication
+
+Need to cast to size_t before multiplication otherwise overflow check is useless.
+---
+ src/lib/openjp2/pi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lib/openjp2/pi.c b/src/lib/openjp2/pi.c
+index 36e2ff0..809b33d 100644
+--- a/src/lib/openjp2/pi.c
++++ b/src/lib/openjp2/pi.c
+@@ -1241,7 +1241,7 @@ opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image,
+ l_current_pi->include = 00;
+ if (l_step_l <= (SIZE_MAX / (l_tcp->numlayers + 1U)))
+ {
+- l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16));
++ l_current_pi->include = (OPJ_INT16*) opj_calloc((size_t)(l_tcp->numlayers + 1U) * l_step_l, sizeof(OPJ_INT16));
+ }
+
+ if
+--
+2.10.0
+