Re: [PATCH v2] Omit User-Agent: header by default
[notmuch-archives.git] / 0b / 6815932c9dc7d49f3710e7879233aee9d5779d
1 Return-Path: <bremner@pivot.cs.unb.ca>\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 206AB4196F0\r
6         for <notmuch@notmuchmail.org>; Thu,  1 Apr 2010 04:40:46 -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: 0.8\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.8 tagged_above=-999 required=5 tests=[BAYES_50=0.8]\r
12         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 kk5maBuC++s7 for <notmuch@notmuchmail.org>;\r
16         Thu,  1 Apr 2010 04:40:45 -0700 (PDT)\r
17 Received: from pivot.cs.unb.ca (pivot.cs.unb.ca [131.202.240.57])\r
18         by olra.theworths.org (Postfix) with ESMTP id 357B8431FC1\r
19         for <notmuch@notmuchmail.org>; Thu,  1 Apr 2010 04:40:45 -0700 (PDT)\r
20 Received: from\r
21         fctnnbsc30w-142167190087.pppoe-dynamic.high-speed.nb.bellaliant.net\r
22         ([142.167.190.87] helo=rocinante.cs.unb.ca)\r
23         by pivot.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)\r
24         (Exim 4.69) (envelope-from <bremner@pivot.cs.unb.ca>)\r
25         id 1NxIlP-00082w-Pu; Thu, 01 Apr 2010 08:40:44 -0300\r
26 Received: from bremner by rocinante.cs.unb.ca with local (Exim 4.71)\r
27         (envelope-from <bremner@rocinante.cs.unb.ca>)\r
28         id 1NxIlJ-0007LM-HD; Thu, 01 Apr 2010 08:40:37 -0300\r
29 From: David Bremner <david@tethera.net>\r
30 To: Gregor Hoffleit <gregor@hoffleit.de>, notmuch <notmuch@notmuchmail.org>\r
31 In-Reply-To: <1267699753-sup-3919@sam.mediasupervision.de>\r
32 References: <1267699753-sup-3919@sam.mediasupervision.de>\r
33 Date: Thu, 01 Apr 2010 08:40:37 -0300\r
34 Message-ID: <871vezs8ne.fsf@rocinante.cs.unb.ca>\r
35 MIME-Version: 1.0\r
36 Content-Type: text/plain; charset=us-ascii\r
37 X-Sender-Verified: bremner@pivot.cs.unb.ca\r
38 Subject: Re: [notmuch] [PATCH] format_part_json: part_content->data is not\r
39  null terminated\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Thu, 01 Apr 2010 11:40:46 -0000\r
53 \r
54 On Thu, 04 Mar 2010 11:49:48 +0100, Gregor Hoffleit <gregor@hoffleit.de> wrote:\r
55 > In format_part_json, part_content->data is not a null terminated\r
56 > string.\r
57 \r
58 I'd like to see this bug fixed, and the patch is pretty small, but...\r
59 \r
60 > Instead, we have to use part_content->len.\r
61 > +     content_data = talloc_size (ctx, part_content->len+1);\r
62 > +     memcpy (content_data, (char *)part_content->data, part_content->len+1);\r
63 \r
64 Can anyone explain why we copy (what seems to me to be) one extra byte\r
65 here?  In principle reading outside our allocated memory could cause\r
66 problems; at minimum it makes a false positive for a memory checker like\r
67 valgrind.\r
68 \r
69 David\r