--- /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 91465431FB6\r
+ for <notmuch@notmuchmail.org>; Fri, 19 Apr 2013 14:14:40 -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 c0exDw3deh-l for <notmuch@notmuchmail.org>;\r
+ Fri, 19 Apr 2013 14:14:40 -0700 (PDT)\r
+Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81])\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 E3E13431FAE\r
+ for <notmuch@notmuchmail.org>; Fri, 19 Apr 2013 14:14:39 -0700 (PDT)\r
+Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])\r
+ by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with\r
+ ESMTP id r3JLEbwO021731\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);\r
+ Fri, 19 Apr 2013 21:14:38 GMT\r
+Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230])\r
+ by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id\r
+ r3JLEaUC027226\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL);\r
+ Fri, 19 Apr 2013 21:14:37 GMT\r
+Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])\r
+ by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id\r
+ r3JLEa8J014693; Fri, 19 Apr 2013 21:14:36 GMT\r
+Received: from pub.cz.oracle.com (/10.163.101.122)\r
+ by default (Oracle Beehive Gateway v4.0)\r
+ with ESMTP ; Fri, 19 Apr 2013 14:14:36 -0700\r
+From: Vladimir.Marek@oracle.com\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] don't store temporary value returned from c_str()\r
+Date: Fri, 19 Apr 2013 23:12:13 +0200\r
+Message-Id: <1366405933-17223-1-git-send-email-Vladimir.Marek@oracle.com>\r
+X-Mailer: git-send-email 1.7.3.2\r
+X-Source-IP: ucsinet21.oracle.com [156.151.31.93]\r
+Cc: 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: Fri, 19 Apr 2013 21:14:40 -0000\r
+\r
+From: Vladimir Marek <vlmarek@volny.cz>\r
+\r
+This is causing problems when compiled by Oracle Studio. Memory pointed\r
+by (const char*)term was already changed once talloc_strdup was called.\r
+\r
+Signed-off-by: Vladimir Marek <vlmarek@volny.cz>\r
+---\r
+ lib/message.cc | 9 ++++-----\r
+ 1 files changed, 4 insertions(+), 5 deletions(-)\r
+\r
+diff --git a/lib/message.cc b/lib/message.cc\r
+index 8720c1b..8d329d1 100644\r
+--- a/lib/message.cc\r
++++ b/lib/message.cc\r
+@@ -266,18 +266,17 @@ _notmuch_message_get_term (notmuch_message_t *message,\r
+ const char *prefix)\r
+ {\r
+ int prefix_len = strlen (prefix);\r
+- const char *term = NULL;\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
++ if (strncmp ((*i).c_str(), prefix, prefix_len))\r
+ return NULL;\r
+ \r
+- value = talloc_strdup (message, term + prefix_len);\r
++ value = talloc_strdup (message, (*i).c_str() + prefix_len);\r
+ \r
+ #if DEBUG_DATABASE_SANITY\r
+ i++;\r
+-- \r
+1.7.3.2\r
+\r