Skip to content

Commit f9f769c

Browse files
committed
Landing rapid7#1805 - Fix unintelligible error when importing empty file
2 parents bdd2287 + 9ab68ac commit f9f769c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/msf/core/db.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,6 +2797,9 @@ def import_file(args={}, &block)
27972797
::File.open(filename, 'rb') do |f|
27982798
data = f.read(4)
27992799
end
2800+
if data.nil?
2801+
raise DBImportError.new("Zero-length file")
2802+
end
28002803

28012804
case data[0,4]
28022805
when "PK\x03\x04"

0 commit comments

Comments
 (0)