balsa r7938 - in trunk: . src



Author: PeterB
Date: Wed Jun  4 20:59:14 2008
New Revision: 7938
URL: http://svn.gnome.org/viewvc/balsa?rev=7938&view=rev

Log:
look further into the value

Modified:
   trunk/ChangeLog
   trunk/src/balsa-mime-widget-message.c

Modified: trunk/src/balsa-mime-widget-message.c
==============================================================================
--- trunk/src/balsa-mime-widget-message.c	(original)
+++ trunk/src/balsa-mime-widget-message.c	Wed Jun  4 20:59:14 2008
@@ -584,8 +584,10 @@
 
         if(bm->shown_headers != HEADERS_ALL) {
             static const gssize MAXLEN = 160;
-            ssize_t all_tag_len = strlen(all_tag)+1;
-            glong header_length = g_utf8_strlen(value, MAXLEN+all_tag_len+5);
+            ssize_t all_tag_len = g_utf8_strlen(all_tag, -1);
+            /* Look far enough into value to be sure that we can tell if
+             * the length is more than MAXLEN+all_tag_len: */
+            glong header_length = g_utf8_strlen(value, 4*(MAXLEN+all_tag_len+1));
             if(header_length > MAXLEN+all_tag_len) {
                 gchar *p = g_utf8_offset_to_pointer(sanitized, MAXLEN);
                 *p = '\0';



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