[evolution-data-server/f19] Add patch for RH bug #981329 (crash in calendar timezone cache)

Milan Crha mcrha at fedoraproject.org
Mon Jul 8 09:46:02 UTC 2013


commit dc09f29df75c9c7354d6bde9e0aa77b2a7a58ada
Author: Milan Crha <mcrha at redhat.com>
Date:   Mon Jul 8 11:45:44 2013 +0200

    Add patch for RH bug #981329 (crash in calendar timezone cache)

 ...tion-data-server-3.8.3-cal-tz-cache-crash.patch |   55 ++++++++++++++++++++
 evolution-data-server.spec                         |    9 +++-
 2 files changed, 63 insertions(+), 1 deletions(-)
---
diff --git a/evolution-data-server-3.8.3-cal-tz-cache-crash.patch b/evolution-data-server-3.8.3-cal-tz-cache-crash.patch
new file mode 100644
index 0000000..3789e6b
--- /dev/null
+++ b/evolution-data-server-3.8.3-cal-tz-cache-crash.patch
@@ -0,0 +1,55 @@
+commit 4fabcb3c68c07c7c384de348d8b8d24491ff1fce
+Author: Matthew Barnes <mbarnes at redhat.com>
+Date:   Wed Jul 3 11:40:39 2013 -0400
+
+    Avoid a crash in cal_backend_add_cached_timezone().
+    
+    Apparently icaltimezone_get_tzid() can sometimes return NULL.  Check for
+    NULL before we use it in a hash table lookup, which crashes on NULL keys.
+    
+    Add a similar check to ECalClient for consistency.
+    
+    (cherry picked from commit 244003d568113a82628bc74b337274a6e8fee433)
+
+diff --git a/calendar/libecal/e-cal-client.c b/calendar/libecal/e-cal-client.c
+index a5615a9..ede024a 100644
+--- a/calendar/libecal/e-cal-client.c
++++ b/calendar/libecal/e-cal-client.c
+@@ -1216,9 +1216,14 @@ cal_client_add_cached_timezone (ETimezoneCache *cache,
+ 
+ 	priv = E_CAL_CLIENT_GET_PRIVATE (cache);
+ 
+-	g_mutex_lock (&priv->zone_cache_lock);
+-
++	/* XXX Apparently this function can sometimes return NULL.
++	 *     I'm not sure when or why that happens, but we can't
++	 *     cache the icaltimezone if it has no tzid string. */
+ 	tzid = icaltimezone_get_tzid (zone);
++	if (tzid == NULL)
++		return;
++
++	g_mutex_lock (&priv->zone_cache_lock);
+ 
+ 	/* Avoid replacing an existing cache entry.  We don't want to
+ 	 * invalidate any icaltimezone pointers that may have already
+diff --git a/calendar/libedata-cal/e-cal-backend.c b/calendar/libedata-cal/e-cal-backend.c
+index f3753f5..4218b45 100644
+--- a/calendar/libedata-cal/e-cal-backend.c
++++ b/calendar/libedata-cal/e-cal-backend.c
+@@ -403,9 +403,14 @@ cal_backend_add_cached_timezone (ETimezoneCache *cache,
+ 
+ 	priv = E_CAL_BACKEND_GET_PRIVATE (cache);
+ 
+-	g_mutex_lock (&priv->zone_cache_lock);
+-
++	/* XXX Apparently this function can sometimes return NULL.
++	 *     I'm not sure when or why that happens, but we can't
++	 *     cache the icaltimezone if it has no tzid string. */
+ 	tzid = icaltimezone_get_tzid (zone);
++	if (tzid == NULL)
++		return;
++
++	g_mutex_lock (&priv->zone_cache_lock);
+ 
+ 	/* Avoid replacing an existing cache entry.  We don't want to
+ 	 * invalidate any icaltimezone pointers that may have already
diff --git a/evolution-data-server.spec b/evolution-data-server.spec
index 0a9c515..a9a4f5f 100644
--- a/evolution-data-server.spec
+++ b/evolution-data-server.spec
@@ -27,7 +27,7 @@
 
 Name: evolution-data-server
 Version: 3.8.3
-Release: 1%{?dist}
+Release: 2%{?dist}
 Group: System Environment/Libraries
 Summary: Backend data server for Evolution
 License: LGPLv2+
@@ -43,6 +43,9 @@ Obsoletes: evolution-webcal < 2.24.0
 # RH bug #243296
 Patch01: evolution-data-server-1.11.5-fix-64bit-acinclude.patch
 
+# RH bug #981329
+Patch02: evolution-data-server-3.8.3-cal-tz-cache-crash.patch
+
 ### Build Dependencies ###
 
 BuildRequires: libdb-devel
@@ -118,6 +121,7 @@ This package contains developer documentation for %{name}.
 %setup -q
 
 %patch01 -p1 -b .fix-64bit-acinclude
+%patch02 -p1 -b .cal-tz-cache-crash
 
 mkdir -p krb5-fakeprefix/include
 mkdir -p krb5-fakeprefix/lib
@@ -366,6 +370,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
 %{_datadir}/gtk-doc/html/libedataserver
 
 %changelog
+* Mon Jul 08 2013 Milan Crha <mcrha at redhat.com> - 3.8.3-2
+- Add patch for RH bug #981329 (crash in calendar timezone cache)
+
 * Mon Jun 10 2013 Milan Crha <mcrha at redhat.com> - 3.8.3-1
 - Update to 3.8.3
 


More information about the scm-commits mailing list