From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E155E6DE0314 for ; Thu, 31 Aug 2017 06:45:12 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.008 X-Spam-Level: X-Spam-Status: No, score=-0.008 tagged_above=-999 required=5 tests=[AWL=0.093, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GTGt9ttcgHTF for ; Thu, 31 Aug 2017 06:45:08 -0700 (PDT) Received: from mail.koumakan.jp (happysky.koumakan.jp [195.154.222.77]) by arlo.cworth.org (Postfix) with ESMTPS id 711066DE0119 for ; Thu, 31 Aug 2017 06:45:08 -0700 (PDT) Received: from localhost (unknown [10.0.0.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.koumakan.jp (Postfix) with ESMTPSA id 3A20AA37E for ; Thu, 31 Aug 2017 22:45:06 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oxij.org; s=default; t=1504187107; bh=MVp1COp6sC/Z0pc9dYG5Yk17ymQmEsyBMWf2wGx8Xow=; h=From:To:Subject:In-Reply-To:References:Date; b=f4NIMqo7fki35YRlhKoyJWdCefOqml8QTd+0Z7c6RnYaHhXaIHt9LzO0lvwpxJKOX VkeYp51k+fP9mXBmYvJO3wKEk5933JrEFls6Jb1BKdhp2hhXvHAwpVc89sMWYXlqgB dtzRDNU+d6ZNmM+jsvQStjiHUk/SgjI9fc9rabgI= From: Jan Malakhovski To: notmuch@notmuchmail.org Subject: Re: [PATCH] crypto: gracefully handle gmime errors In-Reply-To: <20170831133133.9944-1-git-send-email-oxij@oxij.org> References: <20170831133133.9944-1-git-send-email-oxij@oxij.org> Date: Thu, 31 Aug 2017 13:44:56 +0000 Message-ID: <87ziafam1z.fsf@oxij.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Aug 2017 13:45:13 -0000 Hi. On second though @@ -354,6 +357,8 @@ _mime_node_seek_dfs_walk (mime_node_t *node, int *n) *n -= 1; for (i = 0; i < node->nchildren; i++) { mime_node_t *child = mime_node_child (node, i); + if (!child) + return NULL; mime_node_t *ret = _mime_node_seek_dfs_walk (child, n); if (ret) return ret; is probably an incorrect way to do this since the next child node can succeed. Maybe it should be `continue` instead of `return NULL`. Not sure. Feel free to ignore this patch if there's a better way to fix those SIGSEGVs. I get them by building against `gmime-2.6.23` and running `tests/T355-smime.sh` and by trying to open some mails in my inbox (which breaks display in emacs as `notmuch` just crashed in the middle of an s-expression). Cheers, Jan