From: Rich Lane <rlane@club.cc.cmu.edu>
To: sup-devel@rubyforge.org
Subject: [sup-devel] [PATCH] asciify untrusted strings before displaying in TextMode
Date: Tue, 19 Jan 2010 16:48:25 -0500 [thread overview]
Message-ID: <1263937705-10875-1-git-send-email-rlane@club.cc.cmu.edu> (raw)
---
lib/sup/modes/file-browser-mode.rb | 2 +-
lib/sup/modes/text-mode.rb | 2 +-
lib/sup/modes/thread-view-mode.rb | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/sup/modes/file-browser-mode.rb b/lib/sup/modes/file-browser-mode.rb
index b92468d..72e12db 100644
--- a/lib/sup/modes/file-browser-mode.rb
+++ b/lib/sup/modes/file-browser-mode.rb
@@ -47,7 +47,7 @@ protected
return unless f && f.file?
begin
- BufferManager.spawn f.to_s, TextMode.new(f.read)
+ BufferManager.spawn f.to_s, TextMode.new(f.read.ascii)
rescue SystemCallError => e
BufferManager.flash e.message
end
diff --git a/lib/sup/modes/text-mode.rb b/lib/sup/modes/text-mode.rb
index 7c9e7d8..e772ff5 100644
--- a/lib/sup/modes/text-mode.rb
+++ b/lib/sup/modes/text-mode.rb
@@ -29,7 +29,7 @@ class TextMode < ScrollMode
end
if output
- BufferManager.spawn "Output of '#{command}'", TextMode.new(output)
+ BufferManager.spawn "Output of '#{command}'", TextMode.new(output.ascii)
else
BufferManager.flash "'#{command}' done!"
end
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
index b08c819..0e935a4 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -613,7 +613,7 @@ EOS
end
if output
- BufferManager.spawn "Output of '#{command}'", TextMode.new(output)
+ BufferManager.spawn "Output of '#{command}'", TextMode.new(output.ascii)
else
BufferManager.flash "'#{command}' done!"
end
@@ -815,7 +815,7 @@ private
BufferManager.erase_flash
BufferManager.completely_redraw_screen
unless success
- BufferManager.spawn "Attachment: #{chunk.filename}", TextMode.new(chunk.to_s, chunk.filename)
+ BufferManager.spawn "Attachment: #{chunk.filename}", TextMode.new(chunk.to_s.ascii, chunk.filename)
BufferManager.flash "Couldn't execute view command, viewing as text."
end
end
--
1.5.6.5
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
next reply other threads:[~2010-01-19 21:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-19 21:48 Rich Lane [this message]
2010-01-23 12:55 ` William Morgan
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=1263937705-10875-1-git-send-email-rlane@club.cc.cmu.edu \
--to=rlane@club.cc.cmu.edu \
--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