** Part of fix for bnc bug #448079
authorSankar P <psankar@novell.com>
Tue, 23 Dec 2008 09:25:37 +0000 (09:25 +0000)
committerSankarasivasubramanian Pasupathilingam <psankar@src.gnome.org>
Tue, 23 Dec 2008 09:25:37 +0000 (09:25 +0000)
2008-12-23  Sankar P  <psankar@novell.com>

** Part of fix for bnc bug #448079

* camel/providers/groupwise/camel-groupwise-folder.c:
Avoid invalid reads by validating optional fields.
Part 2 of the fixes

svn path=/trunk/; revision=9846

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

index 29d3269..8bf2e59 100644 (file)
@@ -1,3 +1,11 @@
+2008-12-23  Sankar P  <psankar@novell.com>
+
+       ** Part of fix for bnc bug #448079
+
+       * camel/providers/groupwise/camel-groupwise-folder.c:
+       Avoid invalid reads by validating optional fields. 
+       Part 2 of the fixes
+
 2008-12-23  Bharath Acharya  <abharath@novell.com>
 
        ** Fix for bnc bug #449916
index 8842b7a..5ddaca4 100644 (file)
@@ -229,8 +229,11 @@ groupwise_populate_details_from_item (CamelMimeMessage *msg, EGwItem *item)
                time_t actual_time;
                int offset = 0;
                dtstring = e_gw_item_get_creation_date (item);
-               time = e_gw_connection_get_date_from_string (dtstring);
-               actual_time = camel_header_decode_date (ctime(&time), NULL);
+               if (dtstring) {
+                               time = e_gw_connection_get_date_from_string (dtstring);
+                               actual_time = camel_header_decode_date (ctime(&time), NULL);
+               } else
+                               actual_time = (time_t) 0;
                camel_mime_message_set_date (msg, actual_time, offset);
        }
 }
@@ -1674,8 +1677,11 @@ gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex)
                                time_t time;
                                time_t actual_time;
                                temp_date = e_gw_item_get_creation_date (item);
-                               time = e_gw_connection_get_date_from_string (temp_date);
-                               actual_time = camel_header_decode_date (ctime(&time), NULL);
+                               if (temp_date) {
+                                               time = e_gw_connection_get_date_from_string (temp_date);
+                                               actual_time = camel_header_decode_date (ctime(&time), NULL);
+                               } else
+                                               actual_time = (time_t) 0;
                                mi->info.date_sent = mi->info.date_received = actual_time;
                        }
                }