summaryrefslogtreecommitdiff
path: root/graphics/jasper/patches/patch-src_libjasper_jpc_jpc__mqdec.c
blob: 6b95fe44b1038e9776aeb590b88b8c63f1ff0fb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$NetBSD: patch-src_libjasper_jpc_jpc__mqdec.c,v 1.1 2016/05/16 14:03:40 he Exp $

Fix CVE-2008-3520, patches from
https://bugs.gentoo.org/show_bug.cgi?id=222819

--- src/libjasper/jpc/jpc_mqdec.c.orig	2007-01-19 21:43:07.000000000 +0000
+++ src/libjasper/jpc/jpc_mqdec.c
@@ -118,7 +118,7 @@ jpc_mqdec_t *jpc_mqdec_create(int maxctx
 	mqdec->in = in;
 	mqdec->maxctxs = maxctxs;
 	/* Allocate memory for the per-context state information. */
-	if (!(mqdec->ctxs = jas_malloc(mqdec->maxctxs * sizeof(jpc_mqstate_t *)))) {
+	if (!(mqdec->ctxs = jas_alloc2(mqdec->maxctxs, sizeof(jpc_mqstate_t *)))) {
 		goto error;
 	}
 	/* Set the current context to the first context. */