** See bug #315173.
authorVivek Jain <jvivek@novell.com>
Tue, 27 Sep 2005 12:22:12 +0000 (12:22 +0000)
committerJain Vivek <jvivek@src.gnome.org>
Tue, 27 Sep 2005 12:22:12 +0000 (12:22 +0000)
2005-09-27  Vivek Jain <jvivek@novell.com>

** See bug #315173.

* camel-imap-folder.c:(do_append): Null check the
info before using it
initialize flags as we '&' with old value.

camel/providers/imap/ChangeLog
camel/providers/imap/camel-imap-folder.c

index 72543ad..33c161d 100644 (file)
@@ -1,3 +1,11 @@
+2005-09-27  Vivek Jain <jvivek@novell.com>
+
+       ** 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  <tml@novell.com>
 
        * camel-imap-command.c
index bcb4343..a593361 100644 (file)
@@ -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);