diff options
author | Carl Worth <cworth@cworth.org> | 2009-11-06 09:31:03 -0800 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2009-11-06 09:31:03 -0800 |
commit | 98afc279573bfd9528056cb1e9398a286d97a8a3 (patch) | |
tree | 297425c420de0ed9b463d1a54fcbd27d014bd201 | |
parent | 306e19f5ddec1b10a0e99ccc54823544187e7ac3 (diff) |
add_message: Fix segfault for message with no Date header.
I'd fixed this earlier when I had a private copy of GMime's
date-parsing code, but I lost the fix when I recently switched to
calling the GMime function.
-rw-r--r-- | message.cc | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -409,7 +409,12 @@ _notmuch_message_set_date (notmuch_message_t *message, { time_t time_value; - time_value = g_mime_utils_header_decode_date (date, NULL); + /* GMime really doesn't want to see a NULL date, so protect its + * sensibilities. */ + if (date == NULL) + time_value = 0; + else + time_value = g_mime_utils_header_decode_date (date, NULL); message->doc.add_value (NOTMUCH_VALUE_TIMESTAMP, Xapian::sortable_serialise (time_value)); |