From c27ef2a7e10fba6b093e5412f74a4d32577587d3 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 25 Jul 2008 18:00:20 +0000 Subject: [PATCH] ** Fix for bug #544049 2008-07-25 Milan Crha ** Fix for bug #544049 * camel/camel-object.c: Initialize global variables, just to be sure. * camel/providers/imap/camel-imap-summary.c: (EXTRACT_DIGIT): Do not read beyond the buffer. * camel/providers/imap/camel-imap-folder.c: (merge_custom_flags): Pass proper pointer to the 'camel_flag_set' function, otherwise it messes things. svn path=/trunk/; revision=9193 --- camel/ChangeLog | 6 ++++++ camel/camel-object.c | 4 ++-- camel/providers/imap/ChangeLog | 8 ++++++++ camel/providers/imap/camel-imap-folder.c | 2 +- camel/providers/imap/camel-imap-summary.c | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index a41451f..6518620 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,11 @@ 2008-07-25 Milan Crha + ** Part of fix for bug #544049 + + * camel-object.c: Initialize global variables, just to be sure. + +2008-07-25 Milan Crha + ** Fix for bug #544651 * camel-folder-summary.c: (EXTRACT_FIRST_STRING), (EXTRACT_STRING): diff --git a/camel/camel-object.c b/camel/camel-object.c index 8f0e520..b149edc 100644 --- a/camel/camel-object.c +++ b/camel/camel-object.c @@ -142,8 +142,8 @@ static GMutex *ref_lock; static GHashTable *type_table; /* fundamental types are accessed via global */ -CamelType camel_object_type; -CamelType camel_interface_type; +CamelType camel_object_type = CAMEL_INVALID_TYPE; +CamelType camel_interface_type = CAMEL_INVALID_TYPE; #define P_LOCK(l) (pthread_mutex_lock(&l)) #define P_UNLOCK(l) (pthread_mutex_unlock(&l)) diff --git a/camel/providers/imap/ChangeLog b/camel/providers/imap/ChangeLog index 2911f39..bea5582 100644 --- a/camel/providers/imap/ChangeLog +++ b/camel/providers/imap/ChangeLog @@ -1,3 +1,11 @@ +2008-07-25 Milan Crha + + ** Fix for bug #544049 + + * camel-imap-summary.c: (EXTRACT_DIGIT): Do not read beyond the buffer. + * camel-imap-folder.c: (merge_custom_flags): Pass proper pointer to + the 'camel_flag_set' function, otherwise it messes things. + 2008-07-23 Milan Crha ** Part of fix for bug #543943 diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index faca3e0..0307298 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -792,7 +792,7 @@ merge_custom_flags (CamelMessageInfo *mi, const char *custom_flags) /* If this value came from the server, then add it to our local summary, otherwise it was in local summary, but isn't on the server, thus remove it. */ changed = TRUE; - camel_flag_set (mi, p->data, g_hash_table_lookup (server, p->data) != NULL); + camel_flag_set (&((CamelMessageInfoBase *)mi)->user_flags, p->data, g_hash_table_lookup (server, p->data) != NULL); ((CamelMessageInfoBase *) mi)->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED; } } diff --git a/camel/providers/imap/camel-imap-summary.c b/camel/providers/imap/camel-imap-summary.c index 426e158..9c1e468 100644 --- a/camel/providers/imap/camel-imap-summary.c +++ b/camel/providers/imap/camel-imap-summary.c @@ -40,7 +40,7 @@ #define CAMEL_IMAP_SUMMARY_VERSION (3) #define EXTRACT_FIRST_DIGIT(val) val=strtoul (part, &part, 10); -#define EXTRACT_DIGIT(val) part++; val=strtoul (part, &part, 10); +#define EXTRACT_DIGIT(val) if (*part) part++; val=strtoul (part, &part, 10); static int summary_header_load (CamelFolderSummary *, FILE *); static int summary_header_save (CamelFolderSummary *, FILE *); -- 2.7.4