diff --git a/0017-Upgrade-Visual-studio-2017-15.8.patch b/0017-Upgrade-Visual-studio-2017-15.8.patch new file mode 100644 index 0000000..f616e6d --- /dev/null +++ b/0017-Upgrade-Visual-studio-2017-15.8.patch @@ -0,0 +1,172 @@ +From 768f70ca405cd3159d990e962d54456773bb8cf8 Mon Sep 17 00:00:00 2001 +From: Marti Maria +Date: Wed, 15 Aug 2018 20:07:56 +0200 +Subject: [PATCH 17/18] Upgrade Visual studio 2017 15.8 + +- Upgrade to 15.8 +- Add check on CGATS memory allocation (thanks to Quang Nguyen for +pointing out this) +--- + Projects/VC2017/jpegicc/jpegicc.vcxproj | 1 + + Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj | 2 +- + Projects/VC2017/lcms2_static/lcms2_static.vcxproj | 2 +- + Projects/VC2017/linkicc/linkicc.vcxproj | 2 +- + Projects/VC2017/psicc/psicc.vcxproj | 2 +- + Projects/VC2017/testbed/testbed.vcxproj | 2 +- + Projects/VC2017/tiffdiff/tiffdiff.vcxproj | 2 +- + Projects/VC2017/tifficc/tifficc.vcxproj | 2 +- + Projects/VC2017/transicc/transicc.vcxproj | 1 + + src/cmscgats.c | 14 ++++++++++---- + 10 files changed, 19 insertions(+), 11 deletions(-) + +diff --git a/Projects/VC2017/jpegicc/jpegicc.vcxproj b/Projects/VC2017/jpegicc/jpegicc.vcxproj +index ab26a53..39cfd00 100644 +--- a/Projects/VC2017/jpegicc/jpegicc.vcxproj ++++ b/Projects/VC2017/jpegicc/jpegicc.vcxproj +@@ -22,6 +22,7 @@ + {62812507-F926-4968-96A9-17678460AD90} + jpegicc + Win32Proj ++ 10.0.17134.0 + + + +diff --git a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj +index 4c8aa3f..d1bf3eb 100644 +--- a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj ++++ b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj +@@ -22,7 +22,7 @@ + {8C51BE48-ADB8-4089-A9EC-F6BF993A0548} + lcms2_DLL + Win32Proj +- 8.1 ++ 10.0.17134.0 + + + +diff --git a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj +index 2a9988a..9fc05ce 100644 +--- a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj ++++ b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj +@@ -22,7 +22,7 @@ + {71DEDE59-3F1E-486B-A899-4283000F76B5} + lcms2_static + Win32Proj +- 8.1 ++ 10.0.17134.0 + + + +diff --git a/Projects/VC2017/linkicc/linkicc.vcxproj b/Projects/VC2017/linkicc/linkicc.vcxproj +index 30c2b4e..51586dd 100644 +--- a/Projects/VC2017/linkicc/linkicc.vcxproj ++++ b/Projects/VC2017/linkicc/linkicc.vcxproj +@@ -22,7 +22,7 @@ + {FBFBE1DC-DB84-4BA1-9552-B4780F457849} + linkicc + Win32Proj +- 8.1 ++ 10.0.17134.0 + + + +diff --git a/Projects/VC2017/psicc/psicc.vcxproj b/Projects/VC2017/psicc/psicc.vcxproj +index 9dcf89a..8f26e12 100644 +--- a/Projects/VC2017/psicc/psicc.vcxproj ++++ b/Projects/VC2017/psicc/psicc.vcxproj +@@ -22,7 +22,7 @@ + {EF6A8851-65FE-46F5-B9EF-14F0B671F693} + psicc + Win32Proj +- 8.1 ++ 10.0.17134.0 + + + +diff --git a/Projects/VC2017/testbed/testbed.vcxproj b/Projects/VC2017/testbed/testbed.vcxproj +index 0af3762..3f6aea3 100644 +--- a/Projects/VC2017/testbed/testbed.vcxproj ++++ b/Projects/VC2017/testbed/testbed.vcxproj +@@ -22,7 +22,7 @@ + {928A3A2B-46EF-4279-959C-513B3652FF0E} + testbed + Win32Proj +- 8.1 ++ 10.0.17134.0 + + + +diff --git a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj +index 7edfe28..3a6d837 100644 +--- a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj ++++ b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj +@@ -22,7 +22,7 @@ + {75B91835-CCD7-48BE-A606-A9C997D5DBEE} + tiffdiff + Win32Proj +- 8.1 ++ 10.0.17134.0 + + + +diff --git a/Projects/VC2017/tifficc/tifficc.vcxproj b/Projects/VC2017/tifficc/tifficc.vcxproj +index cd9f04c..5ef954f 100644 +--- a/Projects/VC2017/tifficc/tifficc.vcxproj ++++ b/Projects/VC2017/tifficc/tifficc.vcxproj +@@ -22,7 +22,7 @@ + {2256DE16-ED92-4A6F-9C54-F65BB61E64A2} + tifficc + Win32Proj +- 8.1 ++ 10.0.17134.0 + + + +diff --git a/Projects/VC2017/transicc/transicc.vcxproj b/Projects/VC2017/transicc/transicc.vcxproj +index d9b77c6..b3173d8 100644 +--- a/Projects/VC2017/transicc/transicc.vcxproj ++++ b/Projects/VC2017/transicc/transicc.vcxproj +@@ -22,6 +22,7 @@ + {9EE22D66-C849-474C-9ED5-C3E141DAB160} + transicc + Win32Proj ++ 10.0.17134.0 + + + +diff --git a/src/cmscgats.c b/src/cmscgats.c +index 1a87613..8c3e96d 100644 +--- a/src/cmscgats.c ++++ b/src/cmscgats.c +@@ -1,7 +1,7 @@ + //--------------------------------------------------------------------------------- + // + // Little Color Management System +-// Copyright (c) 1998-2017 Marti Maria Saguer ++// Copyright (c) 1998-2018 Marti Maria Saguer + // + // Permission is hereby granted, free of charge, to any person obtaining + // a copy of this software and associated documentation files (the "Software"), +@@ -1506,10 +1506,16 @@ void AllocateDataSet(cmsIT8* it8) + t-> nSamples = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_FIELDS")); + t-> nPatches = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_SETS")); + +- t-> Data = (char**)AllocChunk (it8, ((cmsUInt32Number) t->nSamples + 1) * ((cmsUInt32Number) t->nPatches + 1) *sizeof (char*)); +- if (t->Data == NULL) { ++ if (t -> nSamples < 0 || t->nSamples > 0x7ffe || t->nPatches < 0 || t->nPatches > 0x7ffe) ++ { ++ SynError(it8, "AllocateDataSet: too much data"); ++ } ++ else { ++ t->Data = (char**)AllocChunk(it8, ((cmsUInt32Number)t->nSamples + 1) * ((cmsUInt32Number)t->nPatches + 1) * sizeof(char*)); ++ if (t->Data == NULL) { + +- SynError(it8, "AllocateDataSet: Unable to allocate data array"); ++ SynError(it8, "AllocateDataSet: Unable to allocate data array"); ++ } + } + + } +-- +2.17.1 + diff --git a/lcms2.spec b/lcms2.spec index 6e57b9c..f50cf90 100644 --- a/lcms2.spec +++ b/lcms2.spec @@ -1,12 +1,13 @@ Name: lcms2 Version: 2.9 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Color Management Engine License: MIT URL: http://www.littlecms.com/ Source0: http://www.littlecms.com/lcms2-%{version}.tar.gz ## upstream patches +Patch17: 0017-Upgrade-Visual-studio-2017-15.8.patch BuildRequires: gcc BuildRequires: libjpeg-devel @@ -34,22 +35,25 @@ Provides: littlecms-devel = %{version}-%{release} Development files for LittleCMS. %prep -%setup -q +%autosetup -p1 %build -%configure --disable-static --program-suffix=2 +%configure \ + --disable-static \ + --program-suffix=2 # remove rpath from libtool sed -i.rpath 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i.rpath 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool -make %{?_smp_mflags} +%make_build + %install -make install DESTDIR=${RPM_BUILD_ROOT} INSTALL="install -p" +%make_install -rm -fv ${RPM_BUILD_ROOT}%{_libdir}/lib*.la +rm -fv %{buildroot}%{_libdir}/lib*.la # rename docs (for use with %%doc below) cp -alf doc/LittleCMS2.?\ API.pdf api.pdf @@ -58,12 +62,10 @@ cp -alf doc/LittleCMS2.?\ tutorial.pdf tutorial.pdf %check -make check -k ||: - +%make_build check -k ||: -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%ldconfig_scriptlets %files %doc AUTHORS @@ -80,7 +82,12 @@ make check -k ||: %{_libdir}/liblcms2.so %{_libdir}/pkgconfig/lcms2.pc + %changelog +* Tue Sep 18 2018 Rex Dieter - 2.9-4 +- CVE-2018-16435 lcms2: heap-based buffer overflow in SetData function in cmsIT8LoadFromFile (#1628969) +- .spec cosmetics, use %%make_build %%make_install %%ldconfig_scriptlets + * Fri Jul 13 2018 Fedora Release Engineering - 2.9-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild