Avoid error when generated payload is nil.
parent
e90e6c4885
commit
b58931f803
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue