aboutsummaryrefslogtreecommitdiffstats
path: root/main/libraw
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-02-20 14:44:29 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2018-02-20 14:55:17 +0100
commit7ad00f095f665792e9c615fb0012062026176e87 (patch)
treee184db69d7e38cd76546f0886779e66b0e3d865d /main/libraw
parent75c759004fb1cfec2dff8b94473894cb5902a7e2 (diff)
downloadaports-7ad00f095f665792e9c615fb0012062026176e87.tar.bz2
aports-7ad00f095f665792e9c615fb0012062026176e87.tar.xz
main/libraw: security upgrade to 0.18.6 (CVE-2017-16910)
fixes #8340
Diffstat (limited to 'main/libraw')
-rw-r--r--main/libraw/APKBUILD10
-rw-r--r--main/libraw/CVE-2017-6886_6887.patch85
-rw-r--r--main/libraw/dcraw_narrowing-gcc6.patch92
3 files changed, 3 insertions, 184 deletions
diff --git a/main/libraw/APKBUILD b/main/libraw/APKBUILD
index d6272e721d..a3fed9e8dd 100644
--- a/main/libraw/APKBUILD
+++ b/main/libraw/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libraw
-pkgver=0.17.2
-pkgrel=1
+pkgver=0.18.6
+pkgrel=0
pkgdesc="Library for reading RAW files obtained from digital photo cameras"
url="http://www.libraw.org/"
arch="all"
@@ -10,8 +10,6 @@ depends=""
makedepends=""
subpackages="$pkgname-dev $pkgname-doc"
source="http://www.libraw.org/data/LibRaw-$pkgver.tar.gz
- dcraw_narrowing-gcc6.patch
- CVE-2017-6886_6887.patch
"
builddir="$srcdir"/LibRaw-$pkgver
@@ -39,6 +37,4 @@ package() {
}
-sha512sums="e27227850b09e291802c089c826778579420a4af3f4b94dddf488bfc7eb84335d7a944445287d5993c5a574c192df5117c022d1b3d0372b3539a4553612988f4 LibRaw-0.17.2.tar.gz
-e6a61ee1ac8bfbc2aa87064a621ea549c61896f4095c5a2987317ceaa4231773baccc13429d603d1a891d941e9956beaa8bb115e166cd73aa3cdb486caaa6b01 dcraw_narrowing-gcc6.patch
-e866d6a9c1f86eb1843ac37ab733cad6d26f98247f5da7f7276ea0e7b7bc8dd8d5c8b51c73431255fb25558dea78d422833730fc00885be91a33150a8da52003 CVE-2017-6886_6887.patch"
+sha512sums="ce916a85dcc8ad50a631e9f0e4532d4cc300624b5c78d233531317f33cdf74363cdbcab1fbef3207e89b77bac5be370ef8ff1b806dbb9ae2c4cc0ec607b53e55 LibRaw-0.18.6.tar.gz"
diff --git a/main/libraw/CVE-2017-6886_6887.patch b/main/libraw/CVE-2017-6886_6887.patch
deleted file mode 100644
index a191fd14ed..0000000000
--- a/main/libraw/CVE-2017-6886_6887.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From: Luciano Bello <luciano@debian.org>
-Date: Mon, 21 Aug 2017 12:45:31 -0400
-Subject: Fix for CVE-2017-6886 and CVE-2017-6887
-Origin: https://github.com/LibRaw/LibRaw/commit/d7c3d2cb460be10a3ea7b32e9443a83c243b2251
-CVE: CVE-2017-6886, CVE-2017-6887
-
----
-diff -rup LibRaw-0.17.2.orig/dcraw/dcraw.c LibRaw-0.17.2/dcraw/dcraw.c
---- LibRaw-0.17.2.orig/dcraw/dcraw.c 2016-05-10 21:40:17.000000000 +0000
-+++ LibRaw-0.17.2/dcraw/dcraw.c 2017-09-05 10:23:42.100698094 +0000
-@@ -5837,7 +5837,12 @@ int CLASS parse_tiff_ifd (int base)
- if (!strcmp(model,"DSLR-A100") && tiff_ifd[ifd].width == 3872) {
- load_raw = &CLASS sony_arw_load_raw;
- data_offset = get4()+base;
-- ifd++; break;
-+ ifd++;
-+#ifdef LIBRAW_LIBRARY_BUILD
-+ if (ifd >= sizeof tiff_ifd / sizeof tiff_ifd[0])
-+ throw LIBRAW_EXCEPTION_IO_CORRUPT;
-+#endif
-+ break;
- }
- while (len--) {
- i = ftell(ifp);
-@@ -6001,7 +6006,7 @@ int CLASS parse_tiff_ifd (int base)
- break;
- case 50454: /* Sinar tag */
- case 50455:
-- if (!(cbuf = (char *) malloc(len))) break;
-+ if (len < 1 || len > 2560000 || !(cbuf = (char *) malloc(len))) break;
- fread (cbuf, 1, len, ifp);
- for (cp = cbuf-1; cp && cp < cbuf+len; cp = strchr(cp,'\n'))
- if (!strncmp (++cp,"Neutral ",8))
-@@ -6760,7 +6765,11 @@ int CLASS parse_jpeg (int offset)
- }
- order = get2();
- hlen = get4();
-- if (get4() == 0x48454150) /* "HEAP" */
-+ if (get4() == 0x48454150
-+#ifdef LIBRAW_LIBRARY_BUILD
-+ && (save+hlen) >= 0 && (save+hlen)<=ifp->size()
-+#endif
-+ ) /* "HEAP" */
- parse_ciff (save+hlen, len-hlen, 0);
- if (parse_tiff (save+6)) apply_tiff();
- fseek (ifp, save+len, SEEK_SET);
-diff -rup LibRaw-0.17.2.orig/internal/dcraw_common.cpp LibRaw-0.17.2/internal/dcraw_common.cpp
---- LibRaw-0.17.2.orig/internal/dcraw_common.cpp 2016-05-14 06:55:03.000000000 +0000
-+++ LibRaw-0.17.2/internal/dcraw_common.cpp 2017-09-05 10:23:42.104031489 +0000
-@@ -9060,7 +9060,12 @@ int CLASS parse_tiff_ifd (int base)
- if (!strcmp(model,"DSLR-A100") && tiff_ifd[ifd].t_width == 3872) {
- load_raw = &CLASS sony_arw_load_raw;
- data_offset = get4()+base;
-- ifd++; break;
-+ ifd++;
-+#ifdef LIBRAW_LIBRARY_BUILD
-+ if (ifd >= sizeof tiff_ifd / sizeof tiff_ifd[0])
-+ throw LIBRAW_EXCEPTION_IO_CORRUPT;
-+#endif
-+ break;
- }
- #ifdef LIBRAW_LIBRARY_BUILD
- if (!strncmp(make,"Hasselblad",10) && libraw_internal_data.unpacker_data.hasselblad_parser_flag) {
-@@ -9312,7 +9317,7 @@ int CLASS parse_tiff_ifd (int base)
- break;
- case 50454: /* Sinar tag */
- case 50455:
-- if (!(cbuf = (char *) malloc(len))) break;
-+ if (len < 1 || len > 2560000 || !(cbuf = (char *) malloc(len))) break;
- #ifndef LIBRAW_LIBRARY_BUILD
- fread (cbuf, 1, len, ifp);
- #else
-@@ -10379,7 +10384,11 @@ int CLASS parse_jpeg (int offset)
- }
- order = get2();
- hlen = get4();
-- if (get4() == 0x48454150) /* "HEAP" */
-+ if (get4() == 0x48454150
-+#ifdef LIBRAW_LIBRARY_BUILD
-+ && (save+hlen) >= 0 && (save+hlen)<=ifp->size()
-+#endif
-+ ) /* "HEAP" */
- {
- #ifdef LIBRAW_LIBRARY_BUILD
- imgdata.lens.makernotes.CameraMount = LIBRAW_MOUNT_FixedLens;
diff --git a/main/libraw/dcraw_narrowing-gcc6.patch b/main/libraw/dcraw_narrowing-gcc6.patch
deleted file mode 100644
index 9dd439f85e..0000000000
--- a/main/libraw/dcraw_narrowing-gcc6.patch
+++ /dev/null
@@ -1,92 +0,0 @@
---- ./internal/dcraw_common.cpp
-+++ ./internal/dcraw_common.cpp
-@@ -4417,30 +4417,37 @@ void CLASS lin_interpolate()
- */
- void CLASS vng_interpolate()
- {
-- static const signed char *cp, terms[] = {
-- -2,-2,+0,-1,0,0x01, -2,-2,+0,+0,1,0x01, -2,-1,-1,+0,0,0x01,
-- -2,-1,+0,-1,0,0x02, -2,-1,+0,+0,0,0x03, -2,-1,+0,+1,1,0x01,
-- -2,+0,+0,-1,0,0x06, -2,+0,+0,+0,1,0x02, -2,+0,+0,+1,0,0x03,
-- -2,+1,-1,+0,0,0x04, -2,+1,+0,-1,1,0x04, -2,+1,+0,+0,0,0x06,
-- -2,+1,+0,+1,0,0x02, -2,+2,+0,+0,1,0x04, -2,+2,+0,+1,0,0x04,
-- -1,-2,-1,+0,0,0x80, -1,-2,+0,-1,0,0x01, -1,-2,+1,-1,0,0x01,
-- -1,-2,+1,+0,1,0x01, -1,-1,-1,+1,0,0x88, -1,-1,+1,-2,0,0x40,
-- -1,-1,+1,-1,0,0x22, -1,-1,+1,+0,0,0x33, -1,-1,+1,+1,1,0x11,
-- -1,+0,-1,+2,0,0x08, -1,+0,+0,-1,0,0x44, -1,+0,+0,+1,0,0x11,
-- -1,+0,+1,-2,1,0x40, -1,+0,+1,-1,0,0x66, -1,+0,+1,+0,1,0x22,
-- -1,+0,+1,+1,0,0x33, -1,+0,+1,+2,1,0x10, -1,+1,+1,-1,1,0x44,
-- -1,+1,+1,+0,0,0x66, -1,+1,+1,+1,0,0x22, -1,+1,+1,+2,0,0x10,
-- -1,+2,+0,+1,0,0x04, -1,+2,+1,+0,1,0x04, -1,+2,+1,+1,0,0x04,
-- +0,-2,+0,+0,1,0x80, +0,-1,+0,+1,1,0x88, +0,-1,+1,-2,0,0x40,
-- +0,-1,+1,+0,0,0x11, +0,-1,+2,-2,0,0x40, +0,-1,+2,-1,0,0x20,
-- +0,-1,+2,+0,0,0x30, +0,-1,+2,+1,1,0x10, +0,+0,+0,+2,1,0x08,
-- +0,+0,+2,-2,1,0x40, +0,+0,+2,-1,0,0x60, +0,+0,+2,+0,1,0x20,
-- +0,+0,+2,+1,0,0x30, +0,+0,+2,+2,1,0x10, +0,+1,+1,+0,0,0x44,
-- +0,+1,+1,+2,0,0x10, +0,+1,+2,-1,1,0x40, +0,+1,+2,+0,0,0x60,
-- +0,+1,+2,+1,0,0x20, +0,+1,+2,+2,0,0x10, +1,-2,+1,+0,0,0x80,
-- +1,-1,+1,+1,0,0x88, +1,+0,+1,+2,0,0x08, +1,+0,+2,-1,0,0x40,
-- +1,+0,+2,+1,0,0x10
-- }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 };
-+ struct interpolate_terms {
-+ signed char y1, x1, y2, x2, weight;
-+ unsigned char grads;
-+ };
-+ static const interpolate_terms terms[] = {
-+ {-2,-2,+0,-1,0,0x01}, {-2,-2,+0,+0,1,0x01}, {-2,-1,-1,+0,0,0x01},
-+ {-2,-1,+0,-1,0,0x02}, {-2,-1,+0,+0,0,0x03}, {-2,-1,+0,+1,1,0x01},
-+ {-2,+0,+0,-1,0,0x06}, {-2,+0,+0,+0,1,0x02}, {-2,+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+ {+0,+1,+2,+1,0,0x20}, {+0,+1,+2,+2,0,0x10}, {+1,-2,+1,+0,0,0x80},
-+ {+1,-1,+1,+1,0,0x88}, {+1,+0,+1,+2,0,0x08}, {+1,+0,+2,-1,0,0x40},
-+ {+1,+0,+2,+1,0,0x10}
-+ };
-+ const interpolate_terms *cpt;
-+ signed char *cp;
-+ signed char chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 };
- ushort (*brow[5])[4], *pix;
- int prow=8, pcol=2, *ip, *code[16][16], gval[8], gmin, gmax, sum[4];
- int row, col, x, y, x1, x2, y1, y2, t, weight, grads, color, diag;
-@@ -4456,11 +4463,11 @@ void CLASS vng_interpolate()
- for (row=0; row < prow; row++) /* Precalculate for VNG */
- for (col=0; col < pcol; col++) {
- code[row][col] = ip;
-- for (cp=terms, t=0; t < 64; t++) {
-- y1 = *cp++; x1 = *cp++;
-- y2 = *cp++; x2 = *cp++;
-- weight = *cp++;
-- grads = *cp++;
-+ for (cpt=&terms[0], t=0; t < 64, cpt = &terms[t]; t++) {
-+ y1 = cpt->y1; x1 = cpt->x1;
-+ y2 = cpt->y2; x2 = cpt->x2;
-+ weight = cpt->weight;
-+ grads = cpt->grads;
- color = fcol(row+y1,col+x1);
- if (fcol(row+y2,col+x2) != color) continue;
- diag = (fcol(row,col+1) == color && fcol(row+1,col) == color) ? 2:1;
---- ./internal/dcraw_common.cpp~ 2016-02-24 09:04:39.000000000 -0500
-+++ ./internal/dcraw_common.cpp 2016-02-24 09:06:31.152698597 -0500
-@@ -2469,7 +2469,7 @@
-
- void CLASS kodak_radc_load_raw()
- {
-- static const char src[] = {
-+ static const signed char src[] = {
- 1,1, 2,3, 3,4, 4,2, 5,7, 6,5, 7,6, 7,8,
- 1,0, 2,1, 3,3, 4,4, 5,2, 6,7, 7,6, 8,5, 8,8,
- 2,1, 2,3, 3,0, 3,2, 3,4, 4,6, 5,5, 6,7, 6,8,