SHA256
1
0
forked from pool/ghostscript
ghostscript/CVE-2017-9216.patch
Johannes Meixner 404156ec6d Accepting request 501324 from home:dmolkentin:branches:Printing
- CVE-2017-7207.patch fixes a NULL pointer dereference in mem_get_bits_rectangle
  see https://bugs.ghostscript.com/show_bug.cgi?id=697676
  (bsc#1030263)
- CVE-2017-9216.patch fixes a NULL pointer dereference in jbig2_huffman_get
  see https://bugs.ghostscript.com/show_bug.cgi?id=697934
  (bsc#1040643)

OBS-URL: https://build.opensuse.org/request/show/501324
OBS-URL: https://build.opensuse.org/package/show/Printing/ghostscript?expand=0&rev=79
2017-06-06 09:08:41 +00:00

32 lines
1.4 KiB
Diff

From 3ebffb1d96ba0cacec23016eccb4047dab365853 Mon Sep 17 00:00:00 2001
From: Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
Date: Wed, 24 May 2017 19:29:57 +0100
Subject: [PATCH] Bug 697934: Fix SEGV due to error code being ignored.
The return code from jbig2_decode_text_region was being ignored so the
code continued to try and parse the invalid file using incomplete/empty
structures.
---
jbig2dec/jbig2_symbol_dict.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/jbig2dec/jbig2_symbol_dict.c b/jbig2dec/jbig2_symbol_dict.c
index 3cc17316f..672425d98 100644
--- a/jbig2dec/jbig2_symbol_dict.c
+++ b/jbig2dec/jbig2_symbol_dict.c
@@ -493,8 +493,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]);
--
2.12.3