Accepting request 639800 from home:sbrabec:branches:multimedia:libs

- Add check on CGATS memory allocation (bsc1108813, CVE-2018-16435,
  lcms2-cgats-memory-allocation.patch).

OBS-URL: https://build.opensuse.org/request/show/639800
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/lcms2?expand=0&rev=72
This commit is contained in:
Tomáš Chvátal 2018-10-04 07:31:04 +00:00 committed by Git OBS Bridge
parent d336673524
commit 267e11711b
3 changed files with 60 additions and 4 deletions

View File

@ -0,0 +1,49 @@
Partial patch.
From 768f70ca405cd3159d990e962d54456773bb8cf8 Mon Sep 17 00:00:00 2001
From: Marti Maria <info@littlecms.com>
Date: Wed, 15 Aug 2018 20:07:56 +0200
Subject: [PATCH] Upgrade Visual studio 2017 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/src/cmscgats.c b/src/cmscgats.c
index 1a87613..8c3e96d 100644
--- a/src/cmscgats.c
+++ b/src/cmscgats.c
@@ -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.19.0

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Oct 3 17:34:41 CEST 2018 - sbrabec@suse.com
- Add check on CGATS memory allocation (bsc1108813, CVE-2018-16435,
lcms2-cgats-memory-allocation.patch).
-------------------------------------------------------------------
Mon Nov 27 22:57:10 UTC 2017 - plinnell@opensuse.org

View File

@ -1,7 +1,7 @@
#
# spec file for package lcms2
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@ -55,7 +55,8 @@ Source0: http://sourceforge.net/projects/lcms/files/lcms/%{version}/%{nam
Source1: baselibs.conf
Patch1: lcms2-ocloexec.patch
Patch2: lcms2-visibility.patch
# PATCH-FIX-SECURITY lcms2-cgats-memory-allocation.patch bsc1108813 CVE-2018-16435 sbrabec@suse.cz -- Add check on CGATS memory allocation.
Patch3: lcms2-cgats-memory-allocation.patch
%description
Littlecms is a small speed optimized color management engine.
@ -97,6 +98,7 @@ This package contains user and developer documentation for lcms2.
%setup -q
%patch1
%patch2
%patch3 -p1
chmod a-x doc/* COPYING AUTHORS
@ -109,7 +111,6 @@ export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
# FIXME --without-threads is a workaround for a linker error
%configure --disable-static --without-threads
make %{?_smp_flags}
%check