Skip to content

Commit b58931f

Browse files
author
forzoni
committed
Avoid error when generated payload is nil.
1 parent e90e6c4 commit b58931f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/msf/core/payload_generator.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,15 +333,15 @@ def generate_payload
333333
gen_payload = format_payload(encoded_payload)
334334
end
335335

336-
if format.to_s != 'raw'
337-
cli_print "Final size of #{format} file: #{gen_payload.length} bytes"
338-
end
339-
340336
if gen_payload.nil?
341337
raise PayloadGeneratorError, 'The payload could not be generated, check options'
342338
elsif gen_payload.length > @space and not @smallest
343339
raise PayloadSpaceViolation, 'The payload exceeds the specified space'
344340
else
341+
if format.to_s != 'raw'
342+
cli_print "Final size of #{format} file: #{gen_payload.length} bytes"
343+
end
344+
345345
gen_payload
346346
end
347347
end

0 commit comments

Comments
 (0)