[evolution-data-server/f16] Avoid crash in camel_url_decode_path().

Matthew Barnes mbarnes at fedoraproject.org
Tue Nov 8 18:55:04 UTC 2011


commit 056f0c690491c124462e4530eec2ae470db1aeee
Author: Matthew Barnes <mbarnes at redhat.com>
Date:   Tue Nov 8 13:54:43 2011 -0500

    Avoid crash in camel_url_decode_path().

 ...n-data-server-3.2.1-camel-url-decode-path.patch |   45 ++++++++++++++++++++
 evolution-data-server.spec                         |    7 +++
 2 files changed, 52 insertions(+), 0 deletions(-)
---
diff --git a/evolution-data-server-3.2.1-camel-url-decode-path.patch b/evolution-data-server-3.2.1-camel-url-decode-path.patch
new file mode 100644
index 0000000..067dfd2
--- /dev/null
+++ b/evolution-data-server-3.2.1-camel-url-decode-path.patch
@@ -0,0 +1,45 @@
+diff -up evolution-data-server-3.2.1/camel/camel-url.c.camel-url-decode-path evolution-data-server-3.2.1/camel/camel-url.c
+--- evolution-data-server-3.2.1/camel/camel-url.c.camel-url-decode-path	2011-10-16 05:23:49.000000000 -0400
++++ evolution-data-server-3.2.1/camel/camel-url.c	2011-11-08 13:52:29.950958652 -0500
+@@ -822,28 +822,26 @@ gchar *
+ camel_url_decode_path (const gchar *path)
+ {
+ 	gchar **comps;
+-	gchar *new_path = NULL;
+ 	GString *str;
+-	gint i = 0;
++	guint length, ii;
+ 
+-	if (!path)
+-                return g_strdup("");    /* ??? or NULL? */
++	if (path == NULL || *path == '\0')
++		return g_strdup ("");    /* ??? or NULL? */
+ 
+ 	str = g_string_new (NULL);
+ 
+-        comps = g_strsplit (path, "/", -1);
+-	while (comps[i]) {
+-		camel_url_decode (comps[i]);
+-		g_string_append (str, comps[i]);
+-		g_string_append_c (str, '/');
+-		i++;
+-	}
++	comps = g_strsplit (path, "/", -1);
++	length = g_strv_length (comps);
+ 
+-        /* Strip-off the trailing "/" */
+-	new_path = g_strndup (str->str, str->len - 1);
++	for (ii = 0; ii < length; ii++) {
++		if (ii > 0)
++			g_string_append_c (str, '/');
++		camel_url_decode (comps[ii]);
++		g_string_append (str, comps[ii]);
++	}
+ 
+ 	g_strfreev (comps);
+-	g_string_free (str, TRUE);
+ 
+-	return new_path;
++	return g_string_free (str, FALSE);
+ }
++
diff --git a/evolution-data-server.spec b/evolution-data-server.spec
index f2ac866..8df04d9 100644
--- a/evolution-data-server.spec
+++ b/evolution-data-server.spec
@@ -41,6 +41,9 @@ Obsoletes: evolution-webcal < 2.24.0
 # RH bug #243296
 Patch11: evolution-data-server-1.11.5-fix-64bit-acinclude.patch
 
+# GNOME bug #662643
+Patch12: evolution-data-server-3.2.1-camel-url-decode-path.patch
+
 ### Build Dependencies ###
 
 BuildRequires: GConf2-devel
@@ -120,6 +123,7 @@ This package contains developer documentation for %{name}.
 %setup -q
 
 %patch11 -p1 -b .fix-64bit-acinclude
+%patch12 -p1 -b .camel-url-decode-path
 
 mkdir -p krb5-fakeprefix/include
 mkdir -p krb5-fakeprefix/lib
@@ -343,6 +347,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/gtk-doc/html/libedataserverui
 
 %changelog
+* Tue Nov 08 2011 Matthew Barnes <mbarnes at redhat.com> - 3.2.1-2
+- Add patch for GNOME bug #662643 (crash in camel_url_decode_path).
+
 * Mon Oct 17 2011 Milan Crha <mcrha at redhat.com> - 3.2.1-1
 - Update to 3.2.1
 


More information about the scm-commits mailing list