[Commits] imap.c 1.179.2.260 1.179.2.261

colin at claws-mail.org colin at claws-mail.org
Thu Sep 13 09:47:29 CEST 2012


Update of /home/claws-mail/claws/src
In directory srv:/tmp/cvs-serv1975/src

Modified Files:
      Tag: gtk2
	imap.c 
Log Message:
2012-09-13 [colin]	3.8.1cvs55

	* src/imap.c
		Maybe fix bug #2096, "MEMORY-ERROR w/ 
		Claws-Mail/IMAP and Lotus Domino". Use
		correct types for start/end and test if
		start is indeed before end.

Index: imap.c
===================================================================
RCS file: /home/claws-mail/claws/src/imap.c,v
retrieving revision 1.179.2.260
retrieving revision 1.179.2.261
diff -u -d -r1.179.2.260 -r1.179.2.261
--- imap.c	12 Sep 2012 09:23:12 -0000	1.179.2.260
+++ imap.c	13 Sep 2012 07:47:27 -0000	1.179.2.261
@@ -1713,7 +1713,7 @@
 {
 	GSList *result = NULL;
 	clistiter *list;
-	int start, end, t;
+	guint32 start, end, t;
 	GSList *cur;
 
 	if (!set || !set->set_list)
@@ -1723,8 +1723,10 @@
 		struct mailimap_set_item *item = (struct mailimap_set_item *)clist_content(list);
 		start = item->set_first;
 		end = item->set_last;
-		for (t = start; t <= end; t++) {
-			result = g_slist_prepend(result, GINT_TO_POINTER(t));
+		if (start <= end) {
+			for (t = start; t <= end; t++) {
+				result = g_slist_prepend(result, GINT_TO_POINTER(t));
+			}
 		}
 	}
 	result = g_slist_reverse(result);
@@ -5281,9 +5283,6 @@
 						   GHashTable * tags_hash)
 {
 	unsigned int i;
-	GSList * result;
-	
-	result = NULL;
 	
 	for(i = 0 ; i < carray_count(list) ; i += 3) {
 		uint32_t * puid;



More information about the Commits mailing list