[notmuch] [PATCH] Silence compiler warning by initializing a variable.
authorJeffrey C. Ollie <jeff@ocjtech.us>
Wed, 25 Nov 2009 13:01:36 +0000 (07:01 +1800)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:42 +0000 (09:35 -0800)
ad/268c21c08d4ac6e5552d195905536b7ee019ae [new file with mode: 0644]

diff --git a/ad/268c21c08d4ac6e5552d195905536b7ee019ae b/ad/268c21c08d4ac6e5552d195905536b7ee019ae
new file mode 100644 (file)
index 0000000..909882b
--- /dev/null
@@ -0,0 +1,73 @@
+Return-Path: <jeff@ocjtech.us>\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 3C4E3431FBC\r
+       for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 05:01:49 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\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 LgMevsW8kc66 for <notmuch@notmuchmail.org>;\r
+       Wed, 25 Nov 2009 05:01:48 -0800 (PST)\r
+Received: from mail-yx0-f187.google.com (mail-yx0-f187.google.com\r
+       [209.85.210.187])\r
+       by olra.theworths.org (Postfix) with ESMTP id 5E6BA431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 05:01:48 -0800 (PST)\r
+Received: by yxe17 with SMTP id 17so6586416yxe.33\r
+       for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 05:01:47 -0800 (PST)\r
+Received: by 10.101.152.16 with SMTP id e16mr5186021ano.180.1259154106929;\r
+       Wed, 25 Nov 2009 05:01:46 -0800 (PST)\r
+Received: from lt26923.campus.dmacc.edu ([69.57.47.215])\r
+       by mx.google.com with ESMTPS id 5sm681816yxd.17.2009.11.25.05.01.45\r
+       (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
+       Wed, 25 Nov 2009 05:01:46 -0800 (PST)\r
+Received: from localhost ([127.0.0.1] helo=localhost.localdomain)\r
+       by lt26923.campus.dmacc.edu with esmtps (TLSv1:AES256-SHA:256)\r
+       (Exim 4.69) (envelope-from <jeff@ocjtech.us>)\r
+       id 1NDHV7-0003sA-Lj; Wed, 25 Nov 2009 07:01:41 -0600\r
+From: "Jeffrey C. Ollie" <jeff@ocjtech.us>\r
+To: Not Much Mail <notmuch@notmuchmail.org>\r
+Date: Wed, 25 Nov 2009 07:01:36 -0600\r
+Message-Id: <1259154096-14856-1-git-send-email-jeff@ocjtech.us>\r
+X-Mailer: git-send-email 1.6.5.2\r
+Subject: [notmuch] [PATCH] Silence compiler warning by initializing a\r
+       variable.\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\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: Wed, 25 Nov 2009 13:01:49 -0000\r
+\r
+If Xapian threw an exception on notmuch_query_count_messages the count\r
+variable could be used uninitialized.  Initialize count to solve the\r
+problem.\r
+\r
+Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>\r
+---\r
+ lib/query.cc |    2 +-\r
+ 1 files changed, 1 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/lib/query.cc b/lib/query.cc\r
+index a571a61..9106b92 100644\r
+--- a/lib/query.cc\r
++++ b/lib/query.cc\r
+@@ -315,7 +315,7 @@ notmuch_query_count_messages (notmuch_query_t *query)\r
+ {\r
+     notmuch_database_t *notmuch = query->notmuch;\r
+     const char *query_string = query->query_string;\r
+-    Xapian::doccount count;\r
++    Xapian::doccount count = 0;\r
\r
+     try {\r
+       Xapian::Enquire enquire (*notmuch->xapian_db);\r
+-- \r
+1.6.5.2\r
+\r