--- /dev/null
+Return-Path: <Vladimir.Marek@Oracle.COM>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id B76BD431FB6\r
+ for <notmuch@notmuchmail.org>; Thu, 2 May 2013 06:47:46 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.299\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.299 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_MED=-2.3, UNPARSEABLE_RELAY=0.001]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id GGxPf0EJVozU for <notmuch@notmuchmail.org>;\r
+ Thu, 2 May 2013 06:47:40 -0700 (PDT)\r
+Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 8B7BF431FAF\r
+ for <notmuch@notmuchmail.org>; Thu, 2 May 2013 06:47:40 -0700 (PDT)\r
+Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])\r
+ by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with\r
+ ESMTP id r42DlS1g018481\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);\r
+ Thu, 2 May 2013 13:47:29 GMT\r
+Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85])\r
+ by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id\r
+ r42DlRh7028188\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL);\r
+ Thu, 2 May 2013 13:47:28 GMT\r
+Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66])\r
+ by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id\r
+ r42DlRNj003864; Thu, 2 May 2013 13:47:27 GMT\r
+Received: from pub.cz.oracle.com (/10.163.101.122)\r
+ by default (Oracle Beehive Gateway v4.0)\r
+ with ESMTP ; Thu, 02 May 2013 06:47:27 -0700\r
+Date: Thu, 2 May 2013 15:45:30 +0200\r
+From: Vladimir Marek <Vladimir.Marek@Oracle.COM>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>\r
+Subject: Re: [PATCH 01/24] lib/message.cc: stale pointer bug\r
+Message-ID: <20130502134530.GB23259@pub.cz.oracle.com>\r
+Mail-Followup-To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org,\r
+ Vladimir Marek <vlmarek@volny.cz>\r
+References: <1367444021-2757-1-git-send-email-Vladimir.Marek@oracle.com>\r
+ <m2sj25snsk.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Disposition: inline\r
+In-Reply-To: <m2sj25snsk.fsf@guru.guru-group.fi>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Source-IP: acsinet21.oracle.com [141.146.126.237]\r
+Cc: notmuch@notmuchmail.org, Vladimir Marek <vlmarek@volny.cz>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 02 May 2013 13:47:47 -0000\r
+\r
+> > int prefix_len = strlen (prefix);\r
+> > - const char *term = NULL;\r
+> > + std::string term;\r
+> > char *value;\r
+> > \r
+> > i.skip_to (prefix);\r
+> > \r
+> > - if (i != end)\r
+> > - term = (*i).c_str ();\r
+> > + if (i == end)\r
+> > + return NULL;\r
+> > \r
+> > - if (!term || strncmp (term, prefix, prefix_len))\r
+> > + term = *i;\r
+> \r
+> ... hmm, a raii(?) solution above would be std::string term = *i;\r
+\r
+I'm not sure what's raii (I'm not very good at c++ ...), but I guess you\r
+mean to use 'std::string term = *i;' to avoid copy constructor. That\r
+surely is a good idea. Let me rework the patch!\r
+\r
+-- \r
+ Vlad\r