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 84285429E29 for ; Tue, 10 May 2011 09:25:42 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled 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 gn6vu536LEhu for ; Tue, 10 May 2011 09:25:42 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108]) by olra.theworths.org (Postfix) with ESMTP id 0CCAF429E27 for ; Tue, 10 May 2011 09:25:42 -0700 (PDT) Received: from pip.fifthhorseman.net (lair.fifthhorseman.net [216.254.116.241]) by che.mayfirst.org (Postfix) with ESMTPSA id 5EFE1F970; Tue, 10 May 2011 12:25:39 -0400 (EDT) Received: by pip.fifthhorseman.net (Postfix, from userid 1000) id EF62D11883; Tue, 10 May 2011 12:25:33 -0400 (EDT) From: Daniel Kahn Gillmor To: notmuch@notmuchmail.org Subject: [PATCH] avoid segfault when calling sanitize_string() on NULL Date: Tue, 10 May 2011 12:25:32 -0400 Message-Id: <1305044732-13882-1-git-send-email-dkg@fifthhorseman.net> X-Mailer: git-send-email 1.7.4.4 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: Tue, 10 May 2011 16:25:42 -0000 --- notmuch-search.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c index 794b145..26b24eb 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -116,6 +116,9 @@ sanitize_string (const void *ctx, const char *str) { char *out, *loop; + if (NULL == str) + return NULL; + loop = out = talloc_strdup (ctx, str); for (; *loop; loop++) { -- 1.7.4.4