projects
/
notmuch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46b1b03
)
lib: Handle empty date value
author
Austin Clements
<amdragon@mit.edu>
Mon, 6 Oct 2014 23:17:09 +0000
(17:17 -0600)
committer
David Bremner
<david@tethera.net>
Sat, 11 Oct 2014 05:10:12 +0000
(07:10 +0200)
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.
lib/message.cc
patch
|
blob
|
history
diff --git
a/lib/message.cc
b/lib/message.cc
index bbfc2500bd92f12dfade22db471fb6b22bf9613b..38bc92914163bc92441ee05f8aede64a65d3efca 100644
(file)
--- a/
lib/message.cc
+++ b/
lib/message.cc
@@
-896,6
+896,9
@@
notmuch_message_get_date (notmuch_message_t *message)
return 0;
}
+ if (value.empty ())
+ /* sortable_unserialise is undefined on empty string */
+ return 0;
return Xapian::sortable_unserialise (value);
}