1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-12 11:52:01 +01:00

Detect empty imports

git-svn-id: file:///home/svn/framework3/trunk@11355 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2010-12-16 21:26:39 +00:00
parent 3d52c5c4c0
commit 743cdba360

View File

@ -1963,6 +1963,11 @@ class DBManager
# :amap_log :ip_list, :msf_zip, :libpcap
# If there is no match, an error is raised instead.
def import_filetype_detect(data)
if not (data and data.length > 0)
raise DBImportError.new("The data provided to the import function was empty")
end
if data.kind_of? Zip::ZipFile
raise DBImportError.new("The zip file provided is empty.") if data.entries.empty?
@import_filedata ||= {}