commit d9ff31bf8a03bf67e42b03aaffe1dab5579208fe
parent 1d01edf1832cdc3da92b58f95e65191fd8d7f39e
Author: Michael Hamann <michael@content-space.de>
Date: Sat, 4 Sep 2010 17:51:46 -0400
Fixed inline gpg crash when the end marker is missing
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
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git 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")