Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 28 / 4a9b5ba9b0497ae8802b292b5cb403401d82e4
1 Return-Path: <dme@dme.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 14C9A4196F4\r
6         for <notmuch@notmuchmail.org>; Tue,  6 Apr 2010 00:25:28 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 8s3XXsbQRGop for <notmuch@notmuchmail.org>;\r
16         Tue,  6 Apr 2010 00:25:27 -0700 (PDT)\r
17 Received: from mail-ew0-f219.google.com (mail-ew0-f219.google.com\r
18         [209.85.219.219])\r
19         by olra.theworths.org (Postfix) with ESMTP id 20D3E4196F0\r
20         for <notmuch@notmuchmail.org>; Tue,  6 Apr 2010 00:25:27 -0700 (PDT)\r
21 Received: by ewy19 with SMTP id 19so1297787ewy.2\r
22         for <notmuch@notmuchmail.org>; Tue, 06 Apr 2010 00:25:26 -0700 (PDT)\r
23 Received: by 10.213.37.195 with SMTP id y3mr356427ebd.72.1270538726007;\r
24         Tue, 06 Apr 2010 00:25:26 -0700 (PDT)\r
25 Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com\r
26         [83.217.165.81])\r
27         by mx.google.com with ESMTPS id p10sm27096353gvf.22.2010.04.06.00.25.23\r
28         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
29         Tue, 06 Apr 2010 00:25:24 -0700 (PDT)\r
30 Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
31         id 62FBE5941EC; Tue,  6 Apr 2010 08:25:22 +0100 (BST)\r
32 To: notmuch <notmuch@notmuchmail.org>\r
33 Subject: [PATCH] json: Avoid calling strlen(NULL)\r
34 From: David Edmondson <dme@dme.org>\r
35 Date: Tue, 06 Apr 2010 08:25:22 +0100\r
36 Message-ID: <877holavq5.fsf@ut.hh.sledj.net>\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain; charset=us-ascii\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Tue, 06 Apr 2010 07:25:28 -0000\r
52 \r
53 commit b65817262b3a275ecd0ef1898d92ec5508a9f810\r
54 Author: David Edmondson <dme@dme.org>\r
55 Date:   Tue Apr 6 08:24:00 2010 +0100\r
56 \r
57     json: Avoid calling strlen(NULL)\r
58     \r
59     MIME parts may have no filename, which previously resulted in calling\r
60     strlen(NULL).\r
61 \r
62         Modified json.c\r
63 diff --git a/json.c b/json.c\r
64 index f90b0fa..b73f22a 100644\r
65 --- a/json.c\r
66 +++ b/json.c\r
67 @@ -105,5 +105,8 @@ json_quote_chararray(const void *ctx, const char *str, const size_t len)\r
68  char *\r
69  json_quote_str(const void *ctx, const char *str)\r
70  {\r
71 +    if (str == NULL)\r
72 +       return (char *)"\"\"";\r
73 +\r
74      return (json_quote_chararray (ctx, str, strlen (str)));\r
75  }\r
76 \r
77 \r
78 dme.\r
79 -- \r
80 David Edmondson, http://dme.org\r