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:
parent
3d52c5c4c0
commit
743cdba360
@ -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 ||= {}
|
||||
|
Loading…
Reference in New Issue
Block a user