From 091d18c54c046a08bda9d88982601589a1deea37 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 11 Nov 2009 23:00:58 -0800 Subject: notmuch show: Avoid segmentation for message with no subject. It's safer to return an empty string rather than NULL for missing header values. --- lib/message-file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/message-file.c') diff --git a/lib/message-file.c b/lib/message-file.c index 75caba6d..8a3f8ee0 100644 --- a/lib/message-file.c +++ b/lib/message-file.c @@ -238,7 +238,7 @@ notmuch_message_file_get_header (notmuch_message_file_t *message, return decoded_value; if (message->parsing_finished) - return NULL; + return ""; #define NEXT_HEADER_LINE(closure) \ while (1) { \ @@ -348,5 +348,5 @@ notmuch_message_file_get_header (notmuch_message_file_t *message, header_desired); } - return NULL; + return ""; } -- cgit v1.2.3