From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Sat, 28 May 2011 21:51:52 +0000 (-0700)
Subject: avoid segfault when calling sanitize_string() on NULL
X-Git-Tag: debian/0.6_254~55
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8a7d4aa1b18031f31a1893727870fb5969ff9b3f;p=notmuch.git

avoid segfault when calling sanitize_string() on NULL

Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
---

diff --git a/notmuch-search.c b/notmuch-search.c
index 530cecc3..616fe68a 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++) {