summaryrefslogtreecommitdiff
path: root/graphics/jasper/patches/patch-src_libjasper_mif_mif__cod.c
blob: fe60cdc21af9690e014e6c536ab58e2ddf0010a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$NetBSD: patch-src_libjasper_mif_mif__cod.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/mif/mif_cod.c.orig	2007-01-19 21:43:05.000000000 +0000
+++ src/libjasper/mif/mif_cod.c
@@ -438,8 +438,7 @@ static int mif_hdr_growcmpts(mif_hdr_t *
 	int cmptno;
 	mif_cmpt_t **newcmpts;
 	assert(maxcmpts >= hdr->numcmpts);
-	newcmpts = (!hdr->cmpts) ? jas_malloc(maxcmpts * sizeof(mif_cmpt_t *)) :
-	  jas_realloc(hdr->cmpts, maxcmpts * sizeof(mif_cmpt_t *));
+	newcmpts = jas_realloc2(hdr->cmpts, maxcmpts, sizeof(mif_cmpt_t *));
 	if (!newcmpts) {
 		return -1;
 	}