Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: sup-devel <sup-devel@rubyforge.org>
Subject: [sup-devel] Fix crash on attachment with / in the name
Date: Tue, 09 Nov 2010 12:22:39 -0300	[thread overview]
Message-ID: <1289316052-sup-7690@alvh.no-ip.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 160 bytes --]

This patch fixes an exception when the attachment specifies a filename
with slashes.  This is rare but possible.

-- 
Álvaro Herrera <alvherre@alvh.no-ip.org>

[-- Attachment #2: 0001-Fix-crash-on-handling-attachment-filenames-with.patch --]
[-- Type: application/octet-stream, Size: 764 bytes --]

From c8306e4eb6a9de09dbb697cd5266ebab38cc7aa0 Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Tue, 9 Nov 2010 12:07:27 -0300
Subject: [PATCH 1/3] Fix crash on handling attachment filenames with /

---
 lib/sup/message-chunks.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
index ba1834a..02d28f6 100644
--- a/lib/sup/message-chunks.rb
+++ b/lib/sup/message-chunks.rb
@@ -165,7 +165,7 @@ EOS
     end
 
     def write_to_disk
-      file = Tempfile.new(["sup", @filename || "sup-attachment"])
+      file = Tempfile.new(["sup", @filename.gsub("/", "_") || "sup-attachment"])
       file.print @raw_content
       file.close
       file.path
-- 
1.7.1


[-- Attachment #3: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

             reply	other threads:[~2010-11-09 16:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09 15:22 Alvaro Herrera [this message]
2010-11-15  4:17 ` 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=1289316052-sup-7690@alvh.no-ip.org \
    --to=alvherre@alvh.no-ip.org \
    --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