1 Return-Path: <amdragon@mit.edu>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 378ED431FD0
\r
6 for <notmuch@notmuchmail.org>; Tue, 27 Sep 2011 15:44:04 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id zbLoGS8DCh85 for <notmuch@notmuchmail.org>;
\r
16 Tue, 27 Sep 2011 15:44:03 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 99249431FB6
\r
20 for <notmuch@notmuchmail.org>; Tue, 27 Sep 2011 15:44:03 -0700 (PDT)
\r
21 X-AuditID: 12074422-b7ff56d00000092f-d6-4e8251b150c5
\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])
\r
23 by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 1A.A1.02351.1B1528E4; Tue, 27 Sep 2011 18:44:01 -0400 (EDT)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id p8RMi0dj024998;
\r
27 Tue, 27 Sep 2011 18:44:00 -0400
\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p8RMhwRw014030
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Tue, 27 Sep 2011 18:43:59 -0400 (EDT)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.72)
\r
35 (envelope-from <amdragon@mit.EDU>)
\r
36 id 1R8gPu-0004hP-64; Tue, 27 Sep 2011 18:46:22 -0400
\r
37 Date: Tue, 27 Sep 2011 18:46:22 -0400
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: Ali Polatel <polatel@gmail.com>, David Bremner <david@tethera.net>
\r
40 Subject: Re: Concerns regarding some library functions
\r
41 Message-ID: <20110927224622.GR17905@mit.edu>
\r
42 References: <871uv2unfd.fsf@gmail.com>
\r
43 <87fwjhx6p5.fsf@convex-new.cs.unb.ca>
\r
45 Content-Type: text/plain; charset=us-ascii
\r
46 Content-Disposition: inline
\r
47 In-Reply-To: <87fwjhx6p5.fsf@convex-new.cs.unb.ca>
\r
48 User-Agent: Mutt/1.5.20 (2009-06-14)
\r
49 X-Brightmail-Tracker:
\r
50 H4sIAAAAAAAAA+NgFupmleLIzCtJLcpLzFFi42IRYrdT0d0Y2ORncOIUm8WN1m5Gi+s3ZzJb
\r
51 9O35xurA7LFz1l12j2erbjF7bDn0njmAOYrLJiU1J7MstUjfLoErY+G9K6wFGzgqLn/oZWlg
\r
52 fMbWxcjBISFgIjFpfXUXIyeQKSZx4d56oDAXh5DAPkaJu5v3sUA4GxglLqy9yQzhnGSSuHx/
\r
53 FSuEs4RRouPhA0aQfhYBVYlj7z+A2WwCGhLb9i8Hs0UE3CTu/njKDmIzC0hLfPvdzASyWljA
\r
54 TOLVQjmQMK+AjsSbZX1sILaQgJ/EyTOz2CHighInZz5hgWjVkrjx7yVYK8iY5f84QExOASOJ
\r
55 dU1hIBWiAioS1/a3s01gFJqFpHkWkuZZCM0LGJlXMcqm5Fbp5iZm5hSnJusWJyfm5aUW6Zrq
\r
56 5WaW6KWmlG5iBIe5i9IOxp8HlQ4xCnAwKvHwCjI2+QmxJpYVV+YeYpTkYFIS5RUPAArxJeWn
\r
57 VGYkFmfEF5XmpBYfYpTgYFYS4V1rBpTjTUmsrEotyodJSXOwKInzcu108BMSSE8sSc1OTS1I
\r
58 LYLJynBwKEnw9oEMFSxKTU+tSMvMKUFIM3FwggznARreDFLDW1yQmFucmQ6RP8WoKCXOmwaS
\r
59 EABJZJTmwfXC0tArRnGgV4R5m0CqeIApDK77FdBgJqDBXwsbQQaXJCKkpBoYuULj3l40t/h4
\r
60 OL70q9k39glHJt0Ty+Of0Ou28NMhC/NLr3vD5Cd/OzHrVtfVxX7ul6V/P1756drc4LnzFfu4
\r
61 d63eJnHV/mt6J+v0dnlbsY4IMWY/rafOludX5TaH762Tsjyc8UT6YVuXwlRejX0P2nYWfeG9
\r
62 kFtfvOt7lUnbx9kdolVy8z2fKLEUZyQaajEXFScCAPCErBkeAwAA
\r
63 Cc: notmuch@notmuchmail.org
\r
64 X-BeenThere: notmuch@notmuchmail.org
\r
65 X-Mailman-Version: 2.1.13
\r
67 List-Id: "Use and development of the notmuch mail system."
\r
68 <notmuch.notmuchmail.org>
\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
72 List-Post: <mailto:notmuch@notmuchmail.org>
\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
75 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
76 X-List-Received-Date: Tue, 27 Sep 2011 22:44:04 -0000
\r
78 Quoth David Bremner on Sep 27 at 1:59 pm:
\r
79 > On Tue, 27 Sep 2011 16:25:58 +0300, Ali Polatel <polatel@gmail.com> wrote:
\r
81 > > The problem with their design is NULL return may both mean an error
\r
82 > > condition and "message not found". However, we already have a similar
\r
83 > > function which does not have such a flaw, namely notmuch_database_add_message().
\r
85 > So, I take there is no way to distinguish those two outcomes? That does
\r
86 > sound bad. Looking at the code for notmuch-new, it looks like the return
\r
87 > value of notmuch_database_find_message_by_filename is used without
\r
88 > checking it for NULL. Austin, can you comment on that at all?
\r
90 I'd be happy to distinguish these outcomes. I did
\r
91 notmuch_database_find_message_by_filename the way I did only to be
\r
92 consistent with notmuch_database_find_message. Since ndfmbf isn't
\r
93 entrenched yet, now is a good time to change it.
\r
95 The call in notmuch-new should check the return, though if it can't
\r
96 find the message at that point, something has gone terribly wrong.
\r
97 Segfaulting is never the answer, though.
\r