1 Return-Path: <teythoon@jade-hamburg.de>
\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 E5793431FB6
\r
6 for <notmuch@notmuchmail.org>; Fri, 21 Sep 2012 05:50:54 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 hEv-2e4jwaHR for <notmuch@notmuchmail.org>;
\r
16 Fri, 21 Sep 2012 05:50:53 -0700 (PDT)
\r
17 Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68])
\r
18 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 22C80431FAF
\r
21 for <notmuch@notmuchmail.org>; Fri, 21 Sep 2012 05:50:53 -0700 (PDT)
\r
22 Received: from mail.jade-hamburg.de (mail.jade-hamburg.de [85.183.11.228])
\r
23 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
\r
24 (No client certificate requested)
\r
25 by mail.cryptobitch.de (Postfix) with ESMTPSA id CEF6E5AB08B
\r
26 for <notmuch@notmuchmail.org>; Fri, 21 Sep 2012 14:50:49 +0200 (CEST)
\r
27 Received: by mail.jade-hamburg.de (Postfix, from userid 401)
\r
28 id 3D29BDF2A5; Fri, 21 Sep 2012 14:50:49 +0200 (CEST)
\r
29 Received: from thinkbox.jade-hamburg.de (mail.jade-hamburg.de [85.183.11.228])
\r
30 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
\r
31 (No client certificate requested) (Authenticated sender: teythoon)
\r
32 by mail.jade-hamburg.de (Postfix) with ESMTPSA id E3F94DF2A1;
\r
33 Fri, 21 Sep 2012 14:50:47 +0200 (CEST)
\r
34 Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.80)
\r
35 (envelope-from <teythoon@thinkbox.jade-hamburg.de>)
\r
36 id 1TF2gv-0005fL-DI; Fri, 21 Sep 2012 14:50:45 +0200
\r
37 From: Justus Winter <4winter@informatik.uni-hamburg.de>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH 2/2] Avoid potentially dereferencing a NULL pointer
\r
40 Date: Fri, 21 Sep 2012 14:50:37 +0200
\r
42 <1348231837-21700-2-git-send-email-4winter@informatik.uni-hamburg.de>
\r
43 X-Mailer: git-send-email 1.7.10.4
\r
45 <1348231837-21700-1-git-send-email-4winter@informatik.uni-hamburg.de>
\r
47 <1348231837-21700-1-git-send-email-4winter@informatik.uni-hamburg.de>
\r
48 X-BeenThere: notmuch@notmuchmail.org
\r
49 X-Mailman-Version: 2.1.13
\r
51 List-Id: "Use and development of the notmuch mail system."
\r
52 <notmuch.notmuchmail.org>
\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
56 List-Post: <mailto:notmuch@notmuchmail.org>
\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
59 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
60 X-List-Received-Date: Fri, 21 Sep 2012 12:50:55 -0000
\r
62 GMIME_IS_MULTIPART and GMIME_IS_MESSAGE both handle NULL pointers
\r
63 gracefully, but the G_OBJECT_TYPE used in the error handling block
\r
64 dereferences it without checking it first.
\r
66 Fix this by checking whether parent->part is valid.
\r
68 Found using the clang static analyzer.
\r
70 Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
\r
73 1 file changed, 1 insertion(+), 1 deletion(-)
\r
75 diff --git a/mime-node.c b/mime-node.c
\r
76 index 97e8b48..839737a 100644
\r
79 @@ -291,7 +291,7 @@ mime_node_child (mime_node_t *parent, int child)
\r
83 - if (!parent || child < 0 || child >= parent->nchildren)
\r
84 + if (!parent || !parent->part || child < 0 || child >= parent->nchildren)
\r
87 if (GMIME_IS_MULTIPART (parent->part)) {
\r