aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-03-28 04:16:57 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-03-28 04:16:57 +0800
commit6ba4c3938c305de92ab8e6acbcfc708d8f2d6f9a (patch)
tree1f8976b0d4d45ea6853dd169d6a9ddb8d48aa79c
parenta4f6a54e0abacd14cd5971bb0e52e52cf38324f6 (diff)
downloadgsoc2013-evolution-6ba4c3938c305de92ab8e6acbcfc708d8f2d6f9a.tar
gsoc2013-evolution-6ba4c3938c305de92ab8e6acbcfc708d8f2d6f9a.tar.gz
gsoc2013-evolution-6ba4c3938c305de92ab8e6acbcfc708d8f2d6f9a.tar.bz2
gsoc2013-evolution-6ba4c3938c305de92ab8e6acbcfc708d8f2d6f9a.tar.lz
gsoc2013-evolution-6ba4c3938c305de92ab8e6acbcfc708d8f2d6f9a.tar.xz
gsoc2013-evolution-6ba4c3938c305de92ab8e6acbcfc708d8f2d6f9a.tar.zst
gsoc2013-evolution-6ba4c3938c305de92ab8e6acbcfc708d8f2d6f9a.zip
When we remove a node from the list, make sure to g_list_free_1().
2003-03-27 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_encode_phrase_merge_words): When we remove a node from the list, make sure to g_list_free_1(). (header_encode_phrase_merge_words): Don't use CAMEL_FOLD_PREENCODED as the upper-bound for merged-word length if the merged-word will not be an rfc2047 encoded word. Instead, use CAMEL_FOLD_SIZE-8 (which is the value we use in other places for determining upper-bound lengths). Solves bug #38659. svn path=/trunk/; revision=20549
-rw-r--r--camel/ChangeLog10
-rw-r--r--camel/camel-mime-utils.c6
2 files changed, 15 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 94dad5c5e1..da1b36d2ec 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,13 @@
+2003-03-27 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-mime-utils.c (header_encode_phrase_merge_words): When we
+ remove a node from the list, make sure to g_list_free_1().
+ (header_encode_phrase_merge_words): Don't use
+ CAMEL_FOLD_PREENCODED as the upper-bound for merged-word length if
+ the merged-word will not be an rfc2047 encoded word. Instead, use
+ CAMEL_FOLD_SIZE-8 (which is the value we use in other places for
+ determining upper-bound lengths). Solves bug #38659.
+
2003-03-27 Dan Winship <danw@ximian.com>
* camel-url.c (append_url_encoded): Like camel_url_encode, but
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 04fa0e6f90..6ba498ffa9 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -1561,6 +1561,8 @@ header_encode_phrase_get_words (const unsigned char *in)
return words;
}
+#define MERGED_WORD_LT_FOLDLEN(wordlen, type) ((type) == WORD_2047 ? (wordlen) < CAMEL_FOLD_PREENCODED : (wordlen) < (CAMEL_FOLD_SIZE - 8))
+
static gboolean
header_encode_phrase_merge_words (GList **wordsp)
{
@@ -1578,13 +1580,15 @@ header_encode_phrase_merge_words (GList **wordsp)
next = nextl->data;
/* merge nodes of the same type AND we are not creating too long a string */
if (word_types_compatable (word->type, next->type)) {
- if (next->end - word->start < CAMEL_FOLD_PREENCODED) {
+ if (MERGED_WORD_LT_FOLDLEN (next->end - word->start, MAX (word->type, next->type))) {
/* the resulting word type is the MAX of the 2 types */
word->type = MAX(word->type, next->type);
word->end = next->end;
words = g_list_remove_link (words, nextl);
+ g_list_free_1 (nextl);
g_free (next);
+
nextl = g_list_next (wordl);
merged = TRUE;