Avoid error when generated payload is nil.

bug/bundler_fix
forzoni 2016-07-19 23:43:38 -05:00
parent e90e6c4885
commit b58931f803
1 changed files with 4 additions and 4 deletions

View File

@ -333,15 +333,15 @@ module Msf
gen_payload = format_payload(encoded_payload) gen_payload = format_payload(encoded_payload)
end end
if format.to_s != 'raw'
cli_print "Final size of #{format} file: #{gen_payload.length} bytes"
end
if gen_payload.nil? if gen_payload.nil?
raise PayloadGeneratorError, 'The payload could not be generated, check options' raise PayloadGeneratorError, 'The payload could not be generated, check options'
elsif gen_payload.length > @space and not @smallest elsif gen_payload.length > @space and not @smallest
raise PayloadSpaceViolation, 'The payload exceeds the specified space' raise PayloadSpaceViolation, 'The payload exceeds the specified space'
else else
if format.to_s != 'raw'
cli_print "Final size of #{format} file: #{gen_payload.length} bytes"
end
gen_payload gen_payload
end end
end end