aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-18 01:36:30 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-18 01:36:30 -0800
commitfc3a3be33716675a4169ab4265a28250764b283d (patch)
tree3be711a076a5fe8053a77829a2281eb860395837 /lib
parent024cdf8e3c2e6dd54687c814703e800788b2eebc (diff)
linke_message: Avoid segfault when In-Reply-to header is empty.
This was recently introduced in commit: 64c03ae97f2f5294c60ef25d7f41849864e6ebd3 which was adding extra checks to avoid adding a self-referencing message. How many times am I going to fix a dumb regression like this and say "we really need a test suite" before I actually sit down and write the test suite?
Diffstat (limited to 'lib')
-rw-r--r--lib/database.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/database.cc b/lib/database.cc
index 65478b8a..ce9a86bf 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -726,7 +726,8 @@ _notmuch_database_link_message_to_parents (notmuch_database_t *notmuch,
/* Carefully avoid adding any self-referential in-reply-to term. */
in_reply_to_message_id = _parse_message_id (message, in_reply_to, NULL);
- if (strcmp (in_reply_to_message_id,
+ if (in_reply_to_message_id &&
+ strcmp (in_reply_to_message_id,
notmuch_message_get_message_id (message)))
{
_notmuch_message_add_term (message, "replyto",