From: Vivek Jain Date: Tue, 27 Sep 2005 12:22:12 +0000 (+0000) Subject: ** See bug #315173. X-Git-Tag: upstream/3.7.4~6869 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e9d8f3f0950b808b1afc8d95e5dca7143f997c3;p=platform%2Fupstream%2Fevolution-data-server.git ** See bug #315173. 2005-09-27 Vivek Jain ** See bug #315173. * camel-imap-folder.c:(do_append): Null check the info before using it initialize flags as we '&' with old value. --- diff --git a/camel/providers/imap/ChangeLog b/camel/providers/imap/ChangeLog index 72543ad..33c161d 100644 --- a/camel/providers/imap/ChangeLog +++ b/camel/providers/imap/ChangeLog @@ -1,3 +1,11 @@ +2005-09-27 Vivek Jain + + ** See bug #315173. + + * camel-imap-folder.c:(do_append): Null check the + info before using it + initialize flags as we '&' with old value. + 2005-09-15 Tor Lillqvist * camel-imap-command.c diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index bcb4343..a593361 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -1237,7 +1237,7 @@ do_append (CamelFolder *folder, CamelMimeMessage *message, CamelStreamFilter *streamfilter; GByteArray *ba; char *flagstr, *end; - guint32 flags; + guint32 flags = 0; /* encode any 8bit parts so we avoid sending embedded nul-chars and such */ camel_mime_message_encode_8bit_parts (message); @@ -1260,9 +1260,12 @@ do_append (CamelFolder *folder, CamelMimeMessage *message, /* Some servers dont let us append with custom flags. If the command fails for whatever reason, assume this is the case and save the state and try again */ retry: - flags = camel_message_info_flags(info); - if (!store->nocustomappend) - flags |= imap_label_to_flags((CamelMessageInfo *)info); + if (info) { + flags = camel_message_info_flags(info); + if (!store->nocustomappend) + flags |= imap_label_to_flags((CamelMessageInfo *)info); + } + flags &= folder->permanent_flags; if (flags) flagstr = imap_create_flag_list (flags);