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 8E7A04196F0
\r
6 for <notmuch@notmuchmail.org>; Thu, 1 Apr 2010 04:50:57 -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] 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 2aB84+63Msed for <notmuch@notmuchmail.org>;
\r
16 Thu, 1 Apr 2010 04:50:56 -0700 (PDT)
\r
17 Received: from mail-ww0-f53.google.com (mail-ww0-f53.google.com
\r
18 [74.125.82.53]) by olra.theworths.org (Postfix) with ESMTP id A9523431FC1 for
\r
19 <notmuch@notmuchmail.org>; Thu, 1 Apr 2010 04:50:56 -0700 (PDT)
\r
20 Received: by wwb22 with SMTP id 22so707047wwb.26
\r
21 for <notmuch@notmuchmail.org>; Thu, 01 Apr 2010 04:50:55 -0700 (PDT)
\r
22 Received: by 10.216.85.17 with SMTP id t17mr351388wee.178.1270122655770;
\r
23 Thu, 01 Apr 2010 04:50:55 -0700 (PDT)
\r
24 Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com
\r
26 by mx.google.com with ESMTPS id i34sm19029982gve.24.2010.04.01.04.50.53
\r
27 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
28 Thu, 01 Apr 2010 04:50:53 -0700 (PDT)
\r
29 Received: by ut.hh.sledj.net (Postfix, from userid 1000)
\r
30 id AC38D5941EC; Thu, 1 Apr 2010 12:50:54 +0100 (BST)
\r
31 To: David Bremner <david@tethera.net>, Gregor Hoffleit <gregor@hoffleit.de>,
\r
32 notmuch <notmuch@notmuchmail.org>
\r
33 In-Reply-To: <871vezs8ne.fsf@rocinante.cs.unb.ca>
\r
34 References: <1267699753-sup-3919@sam.mediasupervision.de>
\r
35 <871vezs8ne.fsf@rocinante.cs.unb.ca>
\r
36 From: David Edmondson <dme@dme.org>
\r
37 Date: Thu, 01 Apr 2010 12:50:54 +0100
\r
38 Message-ID: <87634bjsrl.fsf@ut.hh.sledj.net>
\r
40 Content-Type: text/plain; charset=us-ascii
\r
41 Subject: Re: [notmuch] [PATCH] format_part_json: part_content->data is not
\r
43 X-BeenThere: notmuch@notmuchmail.org
\r
44 X-Mailman-Version: 2.1.13
\r
46 List-Id: "Use and development of the notmuch mail system."
\r
47 <notmuch.notmuchmail.org>
\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
51 List-Post: <mailto:notmuch@notmuchmail.org>
\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
55 X-List-Received-Date: Thu, 01 Apr 2010 11:50:57 -0000
\r
57 On Thu, 01 Apr 2010 08:40:37 -0300, David Bremner <david@tethera.net> wrote:
\r
58 > On Thu, 04 Mar 2010 11:49:48 +0100, Gregor Hoffleit <gregor@hoffleit.de> wrote:
\r
59 > > In format_part_json, part_content->data is not a null terminated
\r
62 > I'd like to see this bug fixed,
\r
66 > and the patch is pretty small, but...
\r
68 > > Instead, we have to use part_content->len.
\r
69 > > + content_data = talloc_size (ctx, part_content->len+1);
\r
70 > > + memcpy (content_data, (char *)part_content->data, part_content->len+1);
\r
72 > Can anyone explain why we copy (what seems to me to be) one extra byte
\r
73 > here? In principle reading outside our allocated memory could cause
\r
74 > problems; at minimum it makes a false positive for a memory checker like
\r
77 Agreed. It looks as though this should copy only part_content->len bytes.
\r
81 David Edmondson, http://dme.org
\r