From 90f93fc9c7c6f0b86259c259ee9ba0eb08206b27 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 22 Oct 2009 15:33:56 -0700 Subject: [PATCH] Fix missing error check. The notmuch_message_file_open function is perfectly capable of returning NULL. So check for it. --- database.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/database.cc b/database.cc index 578dce4b..1c0410c2 100644 --- a/database.cc +++ b/database.cc @@ -502,6 +502,10 @@ notmuch_database_add_message (notmuch_database_t *notmuch, unsigned int i; message = notmuch_message_file_open (filename); + if (message == NULL) { + ret = NOTMUCH_STATUS_FILE_ERROR; + goto DONE; + } notmuch_message_file_restrict_headers (message, "date", -- 2.43.0