From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.204.15.139 with SMTP id k11cs69738bka; Sat, 11 Sep 2010 07:04:54 -0700 (PDT) Received: by 10.231.146.136 with SMTP id h8mr2848228ibv.0.1284213893279; Sat, 11 Sep 2010 07:04:53 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id f15si9555507ibb.27.2010.09.11.07.04.52; Sat, 11 Sep 2010 07:04:53 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 5594919782DC; Sat, 11 Sep 2010 10:04:52 -0400 (EDT) Received: from zucker.schokokeks.org (zucker.schokokeks.org [78.46.69.5]) by rubyforge.org (Postfix) with ESMTP id 2E6CB177993F for ; Sat, 11 Sep 2010 10:04:37 -0400 (EDT) Received: from localhost (dslb-088-065-185-146.pools.arcor-ip.net [::ffff:88.65.185.146]) (AUTH: PLAIN michael@content-space.de, TLS: TLSv1/SSLv3, 128bits, AES128-SHA) by zucker.schokokeks.org with esmtp; Sat, 04 Sep 2010 23:52:59 +0200 id 0000000000018005.000000004C82BFBB.00001FE1 From: Michael Hamann To: sup-devel@rubyforge.org Date: Sat, 4 Sep 2010 23:51:46 +0200 Message-Id: <1283637106-18801-1-git-send-email-michael@content-space.de> X-Mailer: git-send-email 1.7.2.2 In-Reply-To: References: Subject: [sup-devel] [PATCH] Fixed inline gpg crash when the end marker is missing X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org lines.between() does not check if the end marker actually exists, but later it is assumed the marker exists. This change introduces a check for the end marker and doesn't decrypt messages in which the end marker is missing. This is a fix for http://rubyforge.org/pipermail/sup-talk/2010-August/004209.html --- lib/sup/message.rb | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/sup/message.rb b/lib/sup/message.rb index 9f488af..69669bd 100644 --- a/lib/sup/message.rb +++ b/lib/sup/message.rb @@ -559,7 +559,8 @@ private end gpg = lines.between(GPG_START, GPG_END) - if !gpg.empty? + # between does not check if GPG_END actually exists + if !gpg.empty? && !lines.index(GPG_END).nil? msg = RMail::Message.new msg.body = gpg.join("\n") -- 1.7.2.2 _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel