mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
lib: Handle empty date value
In the interest of robustness, avoid undefined behavior of sortable_unserialise if the date value is missing. This shouldn't happen now, but ghost messages will have blank date values.
This commit is contained in:
parent
46b1b035a5
commit
7487e2e221
1 changed files with 3 additions and 0 deletions
|
@ -896,6 +896,9 @@ notmuch_message_get_date (notmuch_message_t *message)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (value.empty ())
|
||||||
|
/* sortable_unserialise is undefined on empty string */
|
||||||
|
return 0;
|
||||||
return Xapian::sortable_unserialise (value);
|
return Xapian::sortable_unserialise (value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue