aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-search.c
diff options
context:
space:
mode:
authorGravatar Daniel Kahn Gillmor <dkg@fifthhorseman.net>2011-05-28 14:51:52 -0700
committerGravatar Carl Worth <cworth@cworth.org>2011-06-03 12:30:55 -0700
commit8a7d4aa1b18031f31a1893727870fb5969ff9b3f (patch)
tree2310fbbad2c5f20de5880a4e017ea572d1af0d07 /notmuch-search.c
parentd3fdb76c8d5e1535ead0086821775cf7809d6e1c (diff)
avoid segfault when calling sanitize_string() on NULL
Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
Diffstat (limited to 'notmuch-search.c')
-rw-r--r--notmuch-search.c3
1 files changed, 3 insertions, 0 deletions
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++) {