Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 0F8A24196F2 for ; Mon, 12 Apr 2010 10:45:45 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -4.2 X-Spam-Level: X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9riHP+XkIw3y for ; Mon, 12 Apr 2010 10:45:41 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by olra.theworths.org (Postfix) with ESMTP id 034E3431FC1 for ; Mon, 12 Apr 2010 10:45:40 -0700 (PDT) Received: from localhost ([::1] helo=localhost.localdomain) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1O1Nhc-0002zZ-LY for notmuch@notmuchmail.org; Mon, 12 Apr 2010 17:45:40 +0000 Received: by localhost.localdomain (Postfix, from userid 500) id 355B4C00E4; Mon, 12 Apr 2010 10:45:40 -0700 (PDT) From: Dirk Hohndel To: Subject: [PATCH] Fixing possible dereferencing of NULL pointer Date: Mon, 12 Apr 2010 10:45:40 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Mon, 12 Apr 2010 17:45:45 -0000 I must have misunderstood the cases in which this function can be called It seemed odd to try to manage authors when author==NULL, but that's what we appear to be doing; so now we check that autho != NULL and bail otherwise. Signed-off-by: Dirk Hohndel --- lib/thread.cc | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/thread.cc b/lib/thread.cc index c3c83a3..93a7264 100644 --- a/lib/thread.cc +++ b/lib/thread.cc @@ -88,7 +88,7 @@ _thread_move_matched_author (notmuch_thread_t *thread, char *currentauthor; int idx,nmstart,author_len,authors_len; - if (thread->authors == NULL) + if (thread->authors == NULL || author == NULL) return; if (thread->nonmatched_authors == NULL) thread->nonmatched_authors = thread->authors; -- 1.6.6.1 -- Dirk Hohndel Intel Open Source Technology Center