[arch-commits] Commit in colord/trunk (3 files)

Jan Steffens heftig at archlinux.org
Sun Dec 17 13:56:54 UTC 2017


    Date: Sunday, December 17, 2017 @ 13:56:53
  Author: heftig
Revision: 313253

1.4.1+7+g2c92e03-1

Modified:
  colord/trunk/0001-Make-cd_color_get_blackbody_rgb_full-safer.patch
  colord/trunk/PKGBUILD
Deleted:
  colord/trunk/0002-Avoid-buffer-overflow-when-reading-profile_id.patch

----------------------------------------------------------+
 0001-Make-cd_color_get_blackbody_rgb_full-safer.patch    |   38 ++----
 0002-Avoid-buffer-overflow-when-reading-profile_id.patch |   74 -------------
 PKGBUILD                                                 |   15 +-
 3 files changed, 22 insertions(+), 105 deletions(-)

Modified: 0001-Make-cd_color_get_blackbody_rgb_full-safer.patch
===================================================================
--- 0001-Make-cd_color_get_blackbody_rgb_full-safer.patch	2017-12-17 13:27:04 UTC (rev 313252)
+++ 0001-Make-cd_color_get_blackbody_rgb_full-safer.patch	2017-12-17 13:56:53 UTC (rev 313253)
@@ -1,34 +1,26 @@
-From 264981ddfd1984b25c629d8e3ef6cf25c70cc61a Mon Sep 17 00:00:00 2001
-Message-Id: <264981ddfd1984b25c629d8e3ef6cf25c70cc61a.1513454215.git.jan.steffens at gmail.com>
+From 6d7a6ae89bd12640e863a10fc88b6678f9dc9477 Mon Sep 17 00:00:00 2001
+Message-Id: <6d7a6ae89bd12640e863a10fc88b6678f9dc9477.1513518702.git.jan.steffens at gmail.com>
 From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
 Date: Sat, 16 Dec 2017 04:18:01 +0100
-Subject: [PATCH 1/2] Make cd_color_get_blackbody_rgb_full safer
+Subject: [PATCH] Make cd_color_get_blackbody_rgb_full safer
 
 Validate arguments. If temp is divisible by 100, avoid interpolation
 because it accesses beyond the data for temp == 10000.
 ---
- lib/colord/cd-color.c | 22 ++++++++++++++--------
- 1 file changed, 14 insertions(+), 8 deletions(-)
+ lib/colord/cd-color.c | 23 +++++++++++++++--------
+ 1 file changed, 15 insertions(+), 8 deletions(-)
 
 diff --git a/lib/colord/cd-color.c b/lib/colord/cd-color.c
-index 6062595187616846..3907a7349c1351ba 100644
+index 6062595187616846..9960e7ecd247a289 100644
 --- a/lib/colord/cd-color.c
 +++ b/lib/colord/cd-color.c
-@@ -29,6 +29,7 @@
- #include "config.h"
- 
- #include <math.h>
-+#include <stdlib.h>
- #include <glib-object.h>
- #include <lcms2.h>
- 
-@@ -1444,33 +1445,38 @@ cd_color_get_blackbody_rgb_full (gdouble temp,
+@@ -1444,33 +1444,40 @@ cd_color_get_blackbody_rgb_full (gdouble temp,
  				 CdColorBlackbodyFlags flags)
  {
  	gboolean ret = TRUE;
 -	gdouble alpha;
 -	gint temp_index;
-+	div_t temp_int;
++	guint temp_quot, temp_rem;
  	const CdColorRGB *blackbody_func = blackbody_data_d65modified;
  
 +	g_return_val_if_fail (!isnan (temp), FALSE);
@@ -57,13 +49,15 @@
 -				  &blackbody_func[temp_index + 1],
 -				  alpha,
 -				  result);
-+	temp_int = div (temp, 100);
-+	if (temp_int.rem == 0)
-+		*result = blackbody_func[temp_int.quot - 10];
++	temp_quot = (guint) temp / 100;
++	temp_rem = (guint) temp % 100;
++
++	if (temp_rem == 0)
++		*result = blackbody_func[temp_quot - 10];
 +	else
-+		cd_color_rgb_interpolate (&blackbody_func[temp_int.quot - 10],
-+					  &blackbody_func[temp_int.quot - 9],
-+					  temp_int.rem / 100.0,
++		cd_color_rgb_interpolate (&blackbody_func[temp_quot - 10],
++					  &blackbody_func[temp_quot - 9],
++					  temp_rem / 100.0,
 +					  result);
 +
  	return ret;

Deleted: 0002-Avoid-buffer-overflow-when-reading-profile_id.patch
===================================================================
--- 0002-Avoid-buffer-overflow-when-reading-profile_id.patch	2017-12-17 13:27:04 UTC (rev 313252)
+++ 0002-Avoid-buffer-overflow-when-reading-profile_id.patch	2017-12-17 13:56:53 UTC (rev 313253)
@@ -1,74 +0,0 @@
-From 9b1b755e4dc9b6e91554ee7cd5777f96063a2a0d Mon Sep 17 00:00:00 2001
-Message-Id: <9b1b755e4dc9b6e91554ee7cd5777f96063a2a0d.1513454215.git.jan.steffens at gmail.com>
-In-Reply-To: <264981ddfd1984b25c629d8e3ef6cf25c70cc61a.1513454215.git.jan.steffens at gmail.com>
-References: <264981ddfd1984b25c629d8e3ef6cf25c70cc61a.1513454215.git.jan.steffens at gmail.com>
-From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
-Date: Sat, 16 Dec 2017 20:40:51 +0100
-Subject: [PATCH 2/2] Avoid buffer overflow when reading profile_id
-
-The profile ID is 16 bytes, not 4 bytes. Use the union type specified by
-the LCMS API.
----
- lib/colord/cd-icc.c | 26 +++++++++++++++++++-------
- 1 file changed, 19 insertions(+), 7 deletions(-)
-
-diff --git a/lib/colord/cd-icc.c b/lib/colord/cd-icc.c
-index 99fa27b2988b26d0..0404278f8f2dba39 100644
---- a/lib/colord/cd-icc.c
-+++ b/lib/colord/cd-icc.c
-@@ -227,20 +227,20 @@ gchar *
- cd_icc_to_string (CdIcc *icc)
- {
- 	CdIccPrivate *priv = GET_PRIVATE (icc);
-+	cmsProfileID profile_id;
- 	cmsInt32Number tag_size;
- 	cmsTagSignature sig;
- 	cmsTagSignature sig_link;
- 	cmsTagTypeSignature tag_type;
- 	gboolean ret;
- 	gchar tag_str[5] = "    ";
- 	GDateTime *created;
- 	GError *error_local = NULL;
- 	GString *str;
- 	guint32 i;
- 	guint32 number_tags;
- 	guint32 tmp;
- 	guint64 header_flags;
--	guint8 profile_id[4];
- 
- 	g_return_val_if_fail (CD_IS_ICC (icc), NULL);
- 
-@@ -335,12 +335,24 @@ cd_icc_to_string (CdIcc *icc)
- 	g_string_append_printf (str, "  Creator\t= %s\n", tag_str);
- 
- 	/* profile ID */
--	cmsGetHeaderProfileID (priv->lcms_profile, profile_id);
--	g_string_append_printf (str, "  Profile ID\t= 0x%02x%02x%02x%02x\n",
--				profile_id[0],
--				profile_id[1],
--				profile_id[2],
--				profile_id[3]);
-+	cmsGetHeaderProfileID (priv->lcms_profile, profile_id.ID8);
-+	g_string_append_printf (str, "  Profile ID\t= %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
-+				profile_id.ID8[0],
-+				profile_id.ID8[1],
-+				profile_id.ID8[2],
-+				profile_id.ID8[3],
-+				profile_id.ID8[4],
-+				profile_id.ID8[5],
-+				profile_id.ID8[6],
-+				profile_id.ID8[7],
-+				profile_id.ID8[8],
-+				profile_id.ID8[9],
-+				profile_id.ID8[10],
-+				profile_id.ID8[11],
-+				profile_id.ID8[12],
-+				profile_id.ID8[13],
-+				profile_id.ID8[14],
-+				profile_id.ID8[15]);
- 
- 	/* print tags */
- 	g_string_append (str, "\n");
--- 
-2.15.1
-

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-12-17 13:27:04 UTC (rev 313252)
+++ PKGBUILD	2017-12-17 13:56:53 UTC (rev 313253)
@@ -3,8 +3,8 @@
 # Contributor: Ionut Biru <ibiru at archlinux.org>
 
 pkgname=colord
-pkgver=1.4.1+6+gf08c25d
-pkgrel=2
+pkgver=1.4.1+7+g2c92e03
+pkgrel=1
 pkgdesc="System daemon for managing color devices"
 arch=(x86_64)
 url="https://www.freedesktop.org/software/colord"
@@ -16,14 +16,12 @@
             'argyllcms: color profiling')
 replaces=(shared-color-profiles)
 options=(!emptydirs)
-_commit=f08c25ddd93ad3fa691172119a038465cd178420  # master
+_commit=2c92e03775a15bcd304ef39e9a3220496fc9168a  # master
 source=("git+https://github.com/hughsie/colord#commit=$_commit"
-        0001-Make-cd_color_get_blackbody_rgb_full-safer.patch
-        0002-Avoid-buffer-overflow-when-reading-profile_id.patch)
+        0001-Make-cd_color_get_blackbody_rgb_full-safer.patch)
 sha256sums=('SKIP'
-            '87a617f9fc08097ab702affa7507dd34bf74f97796ab1c0eda524c5ed51d6746'
-            '0d03501dd6142a76f2e74c1f9b8847b40532e0b140f9e4aa01b8ccdcc15b6f5f')
-validpgpkeys=('163EB50119225DB3DF8F49EA17ACBA8DFA970E17')
+            '73689805d46705c8680d9ae979a2f5203f661741e56aa07dc627b36059ab404b')
+validpgpkeys=('163EB50119225DB3DF8F49EA17ACBA8DFA970E17')  # Richard Hughes
 
 pkgver() {
   cd $pkgname
@@ -33,7 +31,6 @@
 prepare() {
   cd $pkgname
   patch -Np1 -i ../0001-Make-cd_color_get_blackbody_rgb_full-safer.patch
-  patch -Np1 -i ../0002-Avoid-buffer-overflow-when-reading-profile_id.patch
 }
 
 build() {



More information about the arch-commits mailing list