From: Michael Hamann <michael@content-space.de>
To: sup-devel@rubyforge.org
Subject: [sup-devel] [PATCH] Fixed inline gpg crash when the end marker is missing
Date: Sat, 4 Sep 2010 23:51:46 +0200 [thread overview]
Message-ID: <1283637106-18801-1-git-send-email-michael@content-space.de> (raw)
In-Reply-To: <AANLkTimw-xi2XCdn3R3QHoDFFv-4cD7GxCoHWxbta-0r@mail.gmail.com>
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
next parent reply other threads:[~2010-09-11 14:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTimw-xi2XCdn3R3QHoDFFv-4cD7GxCoHWxbta-0r@mail.gmail.com>
2010-09-04 21:51 ` Michael Hamann [this message]
2010-09-11 16:42 ` Edward Z. Yang
2010-10-05 11:42 ` Sascha Silbe
2010-10-05 13:09 ` Ben Walton
2010-10-08 4:23 ` Rich Lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1283637106-18801-1-git-send-email-michael@content-space.de \
--to=michael@content-space.de \
--cc=sup-devel@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox