Fixes import of binary data. This may not be a problem for valid imports, but at the least this avoids a stack trace

git-svn-id: file:///home/svn/framework3/trunk@13428 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2011-07-30 18:31:12 +00:00
parent 1fb64f099d
commit b885b8ea74
1 changed files with 3 additions and 2 deletions

View File

@ -2060,8 +2060,9 @@ class DBManager
return :libpcap
end
# Text string kinds of data.
if data and data.to_s.strip.size.zero?
# This is a text string, lets make sure its treated as binary
data = data.unpack("C*").pack("C*")
if data and data.to_s.strip.length == 0
raise DBImportError.new("The data provided to the import function was empty")
end