Patch: Avoid a crash iterating in imap summary if it's corrupted.



Hi,

the attached patch avoids sending an empty ENABLE command when no
relevant extensions supported by camel (currently QRESYNC & CONDSTORE)
are available on the server.

Downstream bug: <https://bugs.maemo.org/show_bug.cgi?id=4803>

L.
Index: libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
===================================================================
--- libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c	(revision 3950)
+++ libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c	(working copy)
@@ -2153,9 +2153,11 @@
 					enable_line = g_string_append (enable_line, "CONDSTORE");
 				}
 
-				response = camel_imap_command (store, NULL, ex, "ENABLE %s", enable_line->str);
-				if (response)
-					camel_imap_response_free_without_processing (store, response);
+				if (enable_line->len) {
+					response = camel_imap_command (store, NULL, ex, "ENABLE %s", enable_line->str);
+					if (response)
+						camel_imap_response_free_without_processing (store, response);
+				}
 				g_string_free (enable_line, TRUE);
 			}
 		}
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 3950)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2009-07-27  Lucas Maneos <tinymail subs maneos org>
+
+	* libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c:
+	avoid sending an empty ENABLE command when the IMAP server's
+	CAPABILITY response does not list any supported extensions.
+
 2009-07-20  Jose Dapena Paz  <jdapena igalia com>
 
 	* libtinymailui-gtk/tny-gtk-folder-list-store.c (get_parent_full_name):


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