Skip to content

Commit 96c459c

Browse files
author
Brent Cook
committed
fix rapid7#6915, handle nil payloads and alert to the user
1 parent a298129 commit 96c459c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/msf/core/payload_generator.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ def generate_payload
332332
cli_print "Payload size: #{encoded_payload.length} bytes"
333333
gen_payload = format_payload(encoded_payload)
334334
end
335-
if gen_payload.length > @space and not @smallest
335+
if gen_payload.nil?
336+
raise PayloadGeneratorError, 'The payload could not be generated, check options'
337+
elsif gen_payload.length > @space and not @smallest
336338
raise PayloadSpaceViolation, 'The payload exceeds the specified space'
337339
else
338340
gen_payload

0 commit comments

Comments
 (0)