Skip to content

Commit 6f26e9e

Browse files
committed
More banner sanity checking.
1 parent 12f0501 commit 6f26e9e

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
lines changed

lib/msf/ui/banner.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ module Banner
3333
def self.readfile(fname)
3434
base = File.expand_path(File.dirname(__FILE__))
3535
pathname = File.join(base, "logos", fname)
36+
fdata = "<< Missing banner: #{fname} >>"
3637
begin
38+
raise ArgumentError unless File.readable?(pathname)
39+
raise ArgumentError unless File.stat(pathname).size < 4096
3740
fdata = File.open(pathname) {|f| f.read f.stat.size}
38-
rescue SystemCallError
39-
fdata = ""
41+
rescue SystemCallError, ArgumentError
42+
nil
4043
end
44+
return fdata
4145
end
4246

4347
def self.to_s
File renamed without changes.

lib/msf/ui/web/r7-metasploit.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)