mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-23 01:44:52 +01:00
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.
This commit is contained in:
parent
306e19f5dd
commit
98afc27957
1 changed files with 6 additions and 1 deletions
|
@ -409,7 +409,12 @@ _notmuch_message_set_date (notmuch_message_t *message,
|
||||||
{
|
{
|
||||||
time_t time_value;
|
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,
|
message->doc.add_value (NOTMUCH_VALUE_TIMESTAMP,
|
||||||
Xapian::sortable_serialise (time_value));
|
Xapian::sortable_serialise (time_value));
|
||||||
|
|
Loading…
Reference in a new issue