summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authornros <nros@pkgsrc.org>2017-08-05 08:03:05 +0000
committernros <nros@pkgsrc.org>2017-08-05 08:03:05 +0000
commit3f038e53a333cdd85344974d8c93339328d7598b (patch)
tree3457e3517dafca199f4a962c638cb143029e738e /graphics
parent0e0e65c627b63177cb9fd05c2985e900d1a8da1d (diff)
downloadpkgsrc-3f038e53a333cdd85344974d8c93339328d7598b.tar.gz
Add patches to fix CVEs:
CVE-2017-7885 CVE-2017-7975 CVE-2017-7976 CVE-2017-9216 Bump PKGREVISION.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/jbig2dec/Makefile3
-rw-r--r--graphics/jbig2dec/distinfo5
-rw-r--r--graphics/jbig2dec/patches/patch-jbig2__huffman.c16
-rw-r--r--graphics/jbig2dec/patches/patch-jbig2__image.c15
-rw-r--r--graphics/jbig2dec/patches/patch-jbig2__symbol__dict.c26
5 files changed, 63 insertions, 2 deletions
diff --git a/graphics/jbig2dec/Makefile b/graphics/jbig2dec/Makefile
index aac796ae745..028b38ea752 100644
--- a/graphics/jbig2dec/Makefile
+++ b/graphics/jbig2dec/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.6 2016/04/13 17:59:34 wiz Exp $
+# $NetBSD: Makefile,v 1.7 2017/08/05 08:03:05 nros Exp $
DISTNAME= jbig2dec-0.13
+PKGREVISION= 1
CATEGORIES= graphics
MASTER_SITES= http://downloads.ghostscript.com/public/jbig2dec/
diff --git a/graphics/jbig2dec/distinfo b/graphics/jbig2dec/distinfo
index 3b122b60b14..f9ff4a87fb1 100644
--- a/graphics/jbig2dec/distinfo
+++ b/graphics/jbig2dec/distinfo
@@ -1,6 +1,9 @@
-$NetBSD: distinfo,v 1.5 2016/04/13 17:59:34 wiz Exp $
+$NetBSD: distinfo,v 1.6 2017/08/05 08:03:05 nros Exp $
SHA1 (jbig2dec-0.13.tar.gz) = d7b07ef308e95dc44a83f2193ca4f445630e6355
RMD160 (jbig2dec-0.13.tar.gz) = 84b4c9730d3a62e75524f4a251379b884cfe00d3
SHA512 (jbig2dec-0.13.tar.gz) = ef64a65c54bec65f61602de7130dc9594aae58aaea7958f7cc987f25d0794511e15a423e86501ace4f40c0364796fb97ceab72edb0b69232926767ba16c1b05d
Size (jbig2dec-0.13.tar.gz) = 442571 bytes
+SHA1 (patch-jbig2__huffman.c) = be3e48b6d324090ffd607babccc602003be54788
+SHA1 (patch-jbig2__image.c) = c0f18948e009be0dc3ba5f0ef67d51538c0cc932
+SHA1 (patch-jbig2__symbol__dict.c) = 5cf647fa56577e540f21772e64e6c2f89f1d647c
diff --git a/graphics/jbig2dec/patches/patch-jbig2__huffman.c b/graphics/jbig2dec/patches/patch-jbig2__huffman.c
new file mode 100644
index 00000000000..f78d2b8ebaf
--- /dev/null
+++ b/graphics/jbig2dec/patches/patch-jbig2__huffman.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-jbig2__huffman.c,v 1.1 2017/08/05 08:03:05 nros Exp $
+* fix CVE-2017-7975
+ fixed upstrema so remove this patch on the next version update.
+--- jbig2_huffman.c.orig 2017-08-05 07:27:45.000000000 +0000
++++ jbig2_huffman.c
+@@ -422,8 +422,8 @@ jbig2_build_huffman_table(Jbig2Ctx *ctx,
+
+ if (PREFLEN == CURLEN) {
+ int RANGELEN = lines[CURTEMP].RANGELEN;
+- int start_j = CURCODE << shift;
+- int end_j = (CURCODE + 1) << shift;
++ uint32_t start_j = CURCODE << shift;
++ uint32_t end_j = (CURCODE + 1) << shift;
+ byte eflags = 0;
+
+ if (end_j > max_j) {
diff --git a/graphics/jbig2dec/patches/patch-jbig2__image.c b/graphics/jbig2dec/patches/patch-jbig2__image.c
new file mode 100644
index 00000000000..acd281ef364
--- /dev/null
+++ b/graphics/jbig2dec/patches/patch-jbig2__image.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-jbig2__image.c,v 1.1 2017/08/05 08:03:05 nros Exp $
+* fix CVE-2017-7976
+ fixed upstream so remove this patch on the next version update
+--- jbig2_image.c.orig 2017-08-05 07:31:46.000000000 +0000
++++ jbig2_image.c
+@@ -256,7 +256,8 @@ jbig2_image_compose(Jbig2Ctx *ctx, Jbig2
+ /* general OR case */
+ s = ss;
+ d = dd = dst->data + y * dst->stride + leftbyte;
+- if (d < dst->data || leftbyte > dst->stride || h * dst->stride < 0 || d - leftbyte + h * dst->stride > dst->data + dst->height * dst->stride) {
++ if (d < dst->data || leftbyte > dst->stride || h * dst->stride < 0 || d - leftbyte + h * dst->stride > dst->data + dst->height * dst->stride ||
++ s - leftbyte + (h - 1) * src->stride + rightbyte > src->data + src->height * src->stride) {
+ return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1, "preventing heap overflow in jbig2_image_compose");
+ }
+ if (leftbyte == rightbyte) {
diff --git a/graphics/jbig2dec/patches/patch-jbig2__symbol__dict.c b/graphics/jbig2dec/patches/patch-jbig2__symbol__dict.c
new file mode 100644
index 00000000000..9dfdb09bbdd
--- /dev/null
+++ b/graphics/jbig2dec/patches/patch-jbig2__symbol__dict.c
@@ -0,0 +1,26 @@
+$NetBSD: patch-jbig2__symbol__dict.c,v 1.1 2017/08/05 08:03:05 nros Exp $
+* fix CVE-2017-7885 and CVE-2017-9216
+ fixed upstream so remove this patch on the next version update
+--- jbig2_symbol_dict.c.orig 2017-08-05 07:24:59.000000000 +0000
++++ jbig2_symbol_dict.c
+@@ -499,8 +499,10 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ }
+
+ /* multiple symbols are handled as a text region */
+- jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts,
++ code = jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts,
+ n_refagg_dicts, image, data, size, GR_stats, as, ws);
++ if (code < 0)
++ goto cleanup4;
+
+ SDNEWSYMS->glyphs[NSYMSDECODED] = image;
+ refagg_dicts[0]->glyphs[params->SDNUMINSYMS + NSYMSDECODED] = jbig2_image_clone(ctx, SDNEWSYMS->glyphs[NSYMSDECODED]);
+@@ -633,7 +635,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ byte *dst = image->data;
+
+ /* SumatraPDF: prevent read access violation */
+- if (size - jbig2_huffman_offset(hs) < image->height * stride) {
++ if ((size - jbig2_huffman_offset(hs) < image->height * stride) || (size < jbig2_huffman_offset(hs))) {
+ jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, "not enough data for decoding (%d/%d)", image->height * stride,
+ size - jbig2_huffman_offset(hs));
+ jbig2_image_release(ctx, image);