unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Justus Winter <4winter@informatik.uni-hamburg.de>
To: notmuch@notmuchmail.org
Subject: [PATCH] Fix error reporting in notmuch_database_find_message_by_filename
Date: Sat, 17 Mar 2012 17:41:27 +0100	[thread overview]
Message-ID: <1332002487-32411-2-git-send-email-4winter@informatik.uni-hamburg.de> (raw)
In-Reply-To: <1332002487-32411-1-git-send-email-4winter@informatik.uni-hamburg.de>

Formerly it was possible for *message_ret to be left
uninitialized. The documentation however clearly states that "[o]n any
failure or when the message is not found, this function initializes
'*message' to NULL".

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
---
 lib/database.cc |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/database.cc b/lib/database.cc
index 8f8df1a..16c4354 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -1825,6 +1825,9 @@ notmuch_database_find_message_by_filename (notmuch_database_t *notmuch,
     if (message_ret == NULL)
 	return NOTMUCH_STATUS_NULL_POINTER;
 
+    /* return NULL on any failure */
+    *message_ret = NULL;
+
     local = talloc_new (notmuch);
 
     try {
-- 
1.7.9.1

  reply	other threads:[~2012-03-17 16:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-17 16:41 Fix error reporting in notmuch_database_find_message_by_filename Justus Winter
2012-03-17 16:41 ` Justus Winter [this message]
2012-03-17 17:26   ` [PATCH] " Austin Clements
2012-03-18 11:46   ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1332002487-32411-2-git-send-email-4winter@informatik.uni-hamburg.de \
    --to=4winter@informatik.uni-hamburg.de \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).