Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] Fix crash on attachment with / in the name
@ 2010-11-09 15:22 Alvaro Herrera
  2010-11-15  4:17 ` Rich Lane
  0 siblings, 1 reply; 2+ messages in thread
From: Alvaro Herrera @ 2010-11-09 15:22 UTC (permalink / raw)
  To: sup-devel

[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-15  5:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-09 15:22 [sup-devel] Fix crash on attachment with / in the name Alvaro Herrera
2010-11-15  4:17 ` Rich Lane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox