gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / patches / lcms-CVE-2018-16435.patch
CommitLineData
8a3bb34c
EF
1https://github.com/mm2/Little-CMS/commit/768f70ca405cd3159d990e962d54456773bb8cf8.patch
2
3From 768f70ca405cd3159d990e962d54456773bb8cf8 Mon Sep 17 00:00:00 2001
4From: Marti Maria <info@littlecms.com>
5Date: Wed, 15 Aug 2018 20:07:56 +0200
6Subject: [PATCH] Upgrade Visual studio 2017 15.8
7
8- Upgrade to 15.8
9- Add check on CGATS memory allocation (thanks to Quang Nguyen for
10pointing out this)
11---
12 Projects/VC2017/jpegicc/jpegicc.vcxproj | 1 +
13 Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj | 2 +-
14 Projects/VC2017/lcms2_static/lcms2_static.vcxproj | 2 +-
15 Projects/VC2017/linkicc/linkicc.vcxproj | 2 +-
16 Projects/VC2017/psicc/psicc.vcxproj | 2 +-
17 Projects/VC2017/testbed/testbed.vcxproj | 2 +-
18 Projects/VC2017/tiffdiff/tiffdiff.vcxproj | 2 +-
19 Projects/VC2017/tifficc/tifficc.vcxproj | 2 +-
20 Projects/VC2017/transicc/transicc.vcxproj | 1 +
21 src/cmscgats.c | 14 ++++++++++----
22 10 files changed, 19 insertions(+), 11 deletions(-)
23
24diff --git a/Projects/VC2017/jpegicc/jpegicc.vcxproj b/Projects/VC2017/jpegicc/jpegicc.vcxproj
25index ab26a53..39cfd00 100644
26--- a/Projects/VC2017/jpegicc/jpegicc.vcxproj
27+++ b/Projects/VC2017/jpegicc/jpegicc.vcxproj
28@@ -22,6 +22,7 @@
29 <ProjectGuid>{62812507-F926-4968-96A9-17678460AD90}</ProjectGuid>
30 <RootNamespace>jpegicc</RootNamespace>
31 <Keyword>Win32Proj</Keyword>
32+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
33 </PropertyGroup>
34 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
35 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36diff --git a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
37index 4c8aa3f..d1bf3eb 100644
38--- a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
39+++ b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
40@@ -22,7 +22,7 @@
41 <ProjectGuid>{8C51BE48-ADB8-4089-A9EC-F6BF993A0548}</ProjectGuid>
42 <RootNamespace>lcms2_DLL</RootNamespace>
43 <Keyword>Win32Proj</Keyword>
44- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
45+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
46 </PropertyGroup>
47 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
48 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
49diff --git a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
50index 2a9988a..9fc05ce 100644
51--- a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
52+++ b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
53@@ -22,7 +22,7 @@
54 <ProjectGuid>{71DEDE59-3F1E-486B-A899-4283000F76B5}</ProjectGuid>
55 <RootNamespace>lcms2_static</RootNamespace>
56 <Keyword>Win32Proj</Keyword>
57- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
58+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
59 </PropertyGroup>
60 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
61 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
62diff --git a/Projects/VC2017/linkicc/linkicc.vcxproj b/Projects/VC2017/linkicc/linkicc.vcxproj
63index 30c2b4e..51586dd 100644
64--- a/Projects/VC2017/linkicc/linkicc.vcxproj
65+++ b/Projects/VC2017/linkicc/linkicc.vcxproj
66@@ -22,7 +22,7 @@
67 <ProjectGuid>{FBFBE1DC-DB84-4BA1-9552-B4780F457849}</ProjectGuid>
68 <RootNamespace>linkicc</RootNamespace>
69 <Keyword>Win32Proj</Keyword>
70- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
71+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
72 </PropertyGroup>
73 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
74 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
75diff --git a/Projects/VC2017/psicc/psicc.vcxproj b/Projects/VC2017/psicc/psicc.vcxproj
76index 9dcf89a..8f26e12 100644
77--- a/Projects/VC2017/psicc/psicc.vcxproj
78+++ b/Projects/VC2017/psicc/psicc.vcxproj
79@@ -22,7 +22,7 @@
80 <ProjectGuid>{EF6A8851-65FE-46F5-B9EF-14F0B671F693}</ProjectGuid>
81 <RootNamespace>psicc</RootNamespace>
82 <Keyword>Win32Proj</Keyword>
83- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
84+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
85 </PropertyGroup>
86 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
87 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
88diff --git a/Projects/VC2017/testbed/testbed.vcxproj b/Projects/VC2017/testbed/testbed.vcxproj
89index 0af3762..3f6aea3 100644
90--- a/Projects/VC2017/testbed/testbed.vcxproj
91+++ b/Projects/VC2017/testbed/testbed.vcxproj
92@@ -22,7 +22,7 @@
93 <ProjectGuid>{928A3A2B-46EF-4279-959C-513B3652FF0E}</ProjectGuid>
94 <RootNamespace>testbed</RootNamespace>
95 <Keyword>Win32Proj</Keyword>
96- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
97+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
98 </PropertyGroup>
99 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
100 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
101diff --git a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
102index 7edfe28..3a6d837 100644
103--- a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
104+++ b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
105@@ -22,7 +22,7 @@
106 <ProjectGuid>{75B91835-CCD7-48BE-A606-A9C997D5DBEE}</ProjectGuid>
107 <RootNamespace>tiffdiff</RootNamespace>
108 <Keyword>Win32Proj</Keyword>
109- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
110+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
111 </PropertyGroup>
112 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
113 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
114diff --git a/Projects/VC2017/tifficc/tifficc.vcxproj b/Projects/VC2017/tifficc/tifficc.vcxproj
115index cd9f04c..5ef954f 100644
116--- a/Projects/VC2017/tifficc/tifficc.vcxproj
117+++ b/Projects/VC2017/tifficc/tifficc.vcxproj
118@@ -22,7 +22,7 @@
119 <ProjectGuid>{2256DE16-ED92-4A6F-9C54-F65BB61E64A2}</ProjectGuid>
120 <RootNamespace>tifficc</RootNamespace>
121 <Keyword>Win32Proj</Keyword>
122- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
123+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
124 </PropertyGroup>
125 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
126 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
127diff --git a/Projects/VC2017/transicc/transicc.vcxproj b/Projects/VC2017/transicc/transicc.vcxproj
128index d9b77c6..b3173d8 100644
129--- a/Projects/VC2017/transicc/transicc.vcxproj
130+++ b/Projects/VC2017/transicc/transicc.vcxproj
131@@ -22,6 +22,7 @@
132 <ProjectGuid>{9EE22D66-C849-474C-9ED5-C3E141DAB160}</ProjectGuid>
133 <RootNamespace>transicc</RootNamespace>
134 <Keyword>Win32Proj</Keyword>
135+ <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
136 </PropertyGroup>
137 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
138 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
139diff --git a/src/cmscgats.c b/src/cmscgats.c
140index 1a87613..8c3e96d 100644
141--- a/src/cmscgats.c
142+++ b/src/cmscgats.c
143@@ -1,7 +1,7 @@
144 //---------------------------------------------------------------------------------
145 //
146 // Little Color Management System
147-// Copyright (c) 1998-2017 Marti Maria Saguer
148+// Copyright (c) 1998-2018 Marti Maria Saguer
149 //
150 // Permission is hereby granted, free of charge, to any person obtaining
151 // a copy of this software and associated documentation files (the "Software"),
152@@ -1506,10 +1506,16 @@ void AllocateDataSet(cmsIT8* it8)
153 t-> nSamples = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_FIELDS"));
154 t-> nPatches = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_SETS"));
155
156- t-> Data = (char**)AllocChunk (it8, ((cmsUInt32Number) t->nSamples + 1) * ((cmsUInt32Number) t->nPatches + 1) *sizeof (char*));
157- if (t->Data == NULL) {
158+ if (t -> nSamples < 0 || t->nSamples > 0x7ffe || t->nPatches < 0 || t->nPatches > 0x7ffe)
159+ {
160+ SynError(it8, "AllocateDataSet: too much data");
161+ }
162+ else {
163+ t->Data = (char**)AllocChunk(it8, ((cmsUInt32Number)t->nSamples + 1) * ((cmsUInt32Number)t->nPatches + 1) * sizeof(char*));
164+ if (t->Data == NULL) {
165
166- SynError(it8, "AllocateDataSet: Unable to allocate data array");
167+ SynError(it8, "AllocateDataSet: Unable to allocate data array");
168+ }
169 }
170
171 }