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
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
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
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
38 Content-Type: text/plain; charset=us-ascii
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.13
\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
53 commit b65817262b3a275ecd0ef1898d92ec5508a9f810
\r
54 Author: David Edmondson <dme@dme.org>
\r
55 Date: Tue Apr 6 08:24:00 2010 +0100
\r
57 json: Avoid calling strlen(NULL)
\r
59 MIME parts may have no filename, which previously resulted in calling
\r
63 diff --git a/json.c b/json.c
\r
64 index f90b0fa..b73f22a 100644
\r
67 @@ -105,5 +105,8 @@ json_quote_chararray(const void *ctx, const char *str, const size_t len)
\r
69 json_quote_str(const void *ctx, const char *str)
\r
72 + return (char *)"\"\"";
\r
74 return (json_quote_chararray (ctx, str, strlen (str)));
\r
80 David Edmondson, http://dme.org
\r