Patch: Avoid returning "" as content location



	Hi,

	This patch avoids camel side returning "" as content location, as this
causes an assert in tinymail code.

Changelog entry:
	* Avoid assert if content location is an empty string.



-- 
José Dapena Paz <jdapena igalia com>
Igalia
diff --git a/ChangeLog b/ChangeLog
index 05df45f..07d0798 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-04-29  Jose Dapena Paz  <jdapena igalia com>
+
+	* Avoid assert if content location is an empty string.
+
 2009-04-23  Jose Dapena Paz  <jdapena igalia com>
 
 	* libtinymailui-gtk/tny-gtk-folder-list-store.c:
diff --git a/libtinymail-camel/camel-lite/camel/camel-mime-utils.c b/libtinymail-camel/camel-lite/camel/camel-mime-utils.c
index 254c1ef..a73e92b 100644
--- a/libtinymail-camel/camel-lite/camel/camel-mime-utils.c
+++ b/libtinymail-camel/camel-lite/camel/camel-mime-utils.c
@@ -3914,7 +3914,12 @@ camel_header_location_decode(const char *in)
 			g_string_append_c(out, c);
 	}
 
-	res = g_strdup(out->str);
+	/* We don't allow empty string as content location, prefer NULL */
+	if (out->str != NULL && out->str[0] == '\0')
+		res = NULL;
+	else
+		res = g_strdup(out->str);
+
 	g_string_free(out, TRUE);
 
 	return res;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]