$OpenBSD: patch-icc_icc_c,v 1.1 2012/09/25 19:51:31 kili Exp $

Fix for CVE-2012-4405 (heap-based buffer overflow). From Redhat.

https://bugzilla.redhat.com/show_bug.cgi?id=854227

--- icc/icc.c.orig	Sun Jan 17 05:04:35 2010
+++ icc/icc.c	Tue Sep 25 20:18:11 2012
@@ -6050,6 +6050,11 @@ static int icmLut_read(
 	p->clutPoints = read_UInt8Number(bp+10);
 
 	/* Sanity check */
+	if (p->inputChan < 1) {
+		sprintf(icp->err,"icmLut_read: No input channels!");
+		return icp->errc = 1;
+	}
+
 	if (p->inputChan > MAX_CHAN) {
 		sprintf(icp->err,"icmLut_read: Can't handle > %d input channels\n",MAX_CHAN);
 		return icp->errc = 1;
