[evolution-patches] fix for bug #50096 - don't index super-long lines (such as uuencoded lines)



notzed and I discussed possibly doing this a few weeks ago, I just never
bothered sending in my patch until now (when someone actually submitted
a bug report about it).

since I had it sitting in my devel tree anyway, here it is.

Jeff

-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com
? 24026.patch
? 49357.patch
? 50096.patch
? charset-map.c
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.1836.2.17
diff -u -r1.1836.2.17 ChangeLog
--- ChangeLog	17 Oct 2003 00:52:53 -0000	1.1836.2.17
+++ ChangeLog	24 Oct 2003 21:42:06 -0000
@@ -1,3 +1,9 @@
+2003-10-24  Jeffrey Stedfast  <fejj ximian com>
+
+	* camel-text-index.c (text_index_name_add_buffer): If a word is
+	longer than CAMEL_TEXT_INDEX_MAX_WORDLEN, then ignore it. This
+	fixes bug #50096.
+
 2003-10-08  Not Zed  <NotZed Ximian com>
 
 	** See Bug #45504
Index: camel-text-index.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-text-index.c,v
retrieving revision 1.16
diff -u -r1.16 camel-text-index.c
--- camel-text-index.c	11 Jun 2003 19:38:33 -0000	1.16
+++ camel-text-index.c	24 Oct 2003 21:42:07 -0000
@@ -55,6 +55,8 @@
 /* cursor debug */
 #define c(x)
 
+#define CAMEL_TEXT_INDEX_MAX_WORDLEN  (36)
+
 #ifdef ENABLE_THREADS
 #define CAMEL_TEXT_INDEX_LOCK(kf, lock) (e_mutex_lock(((CamelTextIndex *)kf)->priv->lock))
 #define CAMEL_TEXT_INDEX_UNLOCK(kf, lock) (e_mutex_unlock(((CamelTextIndex *)kf)->priv->lock))
@@ -1478,11 +1480,12 @@
 			utf8[utf8len] = 0;
 			g_string_append(p->buffer, utf8);
 		} else {
-			if (p->buffer->len) {
+			if (p->buffer->len > 0 && p->buffer->len <= CAMEL_TEXT_INDEX_MAX_WORDLEN) {
 				text_index_name_add_word(idn, p->buffer->str);
 				/*camel_index_name_add_word(idn, p->buffer->str);*/
-				g_string_truncate(p->buffer, 0);
 			}
+			
+			g_string_truncate (p->buffer, 0);
 		}
 	}
 


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