diff --git a/lib/msf/core/db.rb b/lib/msf/core/db.rb index 99f392e2d9..0ffce1493d 100644 --- a/lib/msf/core/db.rb +++ b/lib/msf/core/db.rb @@ -2797,6 +2797,9 @@ class DBManager ::File.open(filename, 'rb') do |f| data = f.read(4) end + if data.nil? + raise DBImportError.new("Zero-length file") + end case data[0,4] when "PK\x03\x04"